How can I force input to uppercase in an asp.net textbox?

Posted by Aheho on Stack Overflow See other posts from Stack Overflow or by Aheho
Published on 2008-10-14T18:54:03Z Indexed on 2010/05/11 23:44 UTC
Read the original article Hit count: 268

Filed under:
|
|
|
|

I'm writing an asp.net application. I have a textbox on a webform and I want to force whatever the user types to upper case. I'd like to do this on the front end. You should also note that there is a validation control on this textbox, so I want to make sure the solution doesn't interfere with the asp.net validation.

Clarification: It appears that the CSS text-tranform makes the user input appear in uppercase, however under the hood, it's still lower case as the validation control fails. You see, my validation control checks to see if a valid state code is entered, however the regex expression I"m using only works with uppercase characters.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript