Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to create rounded corner textbox using jquery . Pls help me. Its urgent

Thank you
Posted
Updated 30-May-12 20:42pm
v2

jQuery Curvy Corners[^]
A free JavaScript library for creating gorgeous rounded corners for HTML block elements:
CurvyCorners[^]
 
Share this answer
 
You can make a rounded corner div and inside that place a text box with no borders. I think this will be the easiest way to accomplish your need:

XML
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.corner.js" type="text/javascript"></script>

<script>
    $(document).ready ( function () {
        $("#div1").corner("round");
    });
</script>

<style>
#div1 { width: 200px; height: 30px; background-color: #a9a9a9; }
#txtBox { width: 180px; height: 20px; background-color: transparent; position: relative; top: 5px; left: 10px; border-style: none; }
</style>


<div id="div1">
    <input type="text" id="txtBox" />
</div>

Ref:stackoverflow.com
 
Share this answer
 
Comments
sumeetkumar001@gmail.com 31-May-12 3:51am    
Hi Prasad,
I have tried the code given by u. Its not working
Devkranth Kishore Vanja 8-Aug-12 11:29am    
I am able to do the rounded corner using jquery... how to change the color of the div when Validation fails :)
HTML
<head  runat="server">
    
    
        .txtbox
        {
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
            border-bottom-left-radius: 20px;
            border-bottom-right-radius: 20px;
        }

</head>


and apply the css class to textbox as:

HTML
<asp:textbox id="TextBox1" runat="server" cssclass=""txtbox"" xmlns:asp="#unknown"></asp:textbox>


[Edit]Code block added[/Edit]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900