Thursday, June 20, 2013

How to get all text in uppercase latters in a textbox using java script in asp.net

use this script in header section :-
--------------------------------

<script type="text/javascript">
        function ToUpper(txt) {
            document.getElementById(txt).value = document.getElementById(txt).value.toUpperCase();
        }
</script>



Take a textbox like this and call the java script function over here. :-
-------------------------------------------------------------------

<asp:TextBox ID="txtCode" runat="server" AutoPostBack="True"
                             ontextchanged="txtCode_TextChanged" MaxLength="99"  onkeypress="ToUpper(this.id)" onblur="ToUpper(this.id)"></asp:TextBox>

No comments:

Post a Comment