How to make Textbox value in Uppercase (caps) using JavaScript

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <%--here we create a javascript function for Caps character --%>
    <script type="text/javascript">
        function Capschar() {
            var x = document.getElementById("txtname");
            x.value = x.value.toUpperCase();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        Enter Your Name
        <asp:TextBox ID="txtname" runat="server" onblur="Capschar();"></asp:TextBox>
    </div>
    </form>
</body>
</html>


Out-put:-


How to make Textbox value in Uppercase (caps) using JavaScript How to make Textbox value in Uppercase (caps) using JavaScript Reviewed by NEERAJ SRIVASTAVA on 11:14:00 AM Rating: 5

No comments:

Powered by Blogger.