Javascript would more than likely be the most cross-browser compatible way. Assign a javascript function to the onKeyPress event of the text field that takes the content of the field and replaces it with the uppercased version.
But there will always be a slightly disconcerting "flash" as the user types.
To avoid the flash, you can do it with CSS, as well... with something like:
by this won't be as cross-browser compatible. So depending on whether it's an intranet app where you might have greater control over what browsers are hitting the page, or an internet app where it's being hit by everything under the sun, that'll kind of decide for you which solution you use.
Of course... the other option is to simply let the user type the value in whatever case they want, and then you capitalize it when it comes time to store it in the database or whatever you're doing with it.
<CFQUERY ...>
INSERT INTO myTable
(firstname) VALUES ('#UCase(FORM.firstname)#')
</CFQUERY>
then it wouldn't matter whether the user typed their first name in upper case, lower case, or mixed case... it would still get stored in all upper case.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.