How to auto Capital Letter when user key-in value on textbox in VB.net

Last Reply on May 10, 2016 02:25 AM By asrul

Posted on May 09, 2016 07:46 PM

Hi friends,

 

How to make auto Capital Letter when user key-in value on textbox in VB.net?

Results 1 - 5 of 6 12
Posted on May 09, 2016 07:46 PM
Hi @asrul,
Please try the following

Make first letter of TextBox Text value Capital (Title Case) in ASP.Net

It might help you.

Cheers Andrea.

Posted on May 09, 2016 07:57 PM

Dear Andrea,

 

I'm not looking for first letter, but i want all value in Capital Letter. Thanks


Posted on May 10, 2016 12:00 AM
try this.

$
("#txtbox").bind('keyup', function (e) { if (e.which >= 97 && e.which <= 122) { var newKey = e.which - 32; e.keyCode = newKey; e.charCode = newKey; } $("#txtbox").val(($("#txtbox").val()).toUpperCase()); });

Posted on May 10, 2016 12:08 AM

Hi KuldeepDev

 

need to add on source code? which area?


Posted on May 10, 2016 02:23 AM

Hi,

Please refer below code.

HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">
        function Capital(txt) {
            txt.value = txt.value.replace(/^\s+/, '').toUpperCase();
        }
    </script>
</head>
<body>
    Enter Name:
    <input type="text" value=" " onkeyup="Capital(this)" />
</body>
</html>
Demo