Monday, March 21, 2011

Change the first letter of the Text Box into Upper Case

How to change the first letter of the Text Box into Upper Case
            In this blog, I am going to explain how to change the first letter of the text box control into uppercase. For this, you need to write a JavaScript code.
First create an asp.net text box control in the page, as given below.
<asp:TextBox ID="FirstName" onchange = "convert(this);" runat="server"></asp:TextBox>

The method name convert() is used to call a JavaScript function. Define the method as given below.
<script type="text/javascript" language="JavaScript">
function convert(controlname)
{
 
    return;
}
</script>

When the text box lost its focus will change the first letter of the word into upper case.

1 comment:

  1. It is really a nice and useful piece of info. I'm happy that you shared this useful info with us. Please stay us up to date like this.

    Thanks for sharing
    Web Design Company

    ReplyDelete