Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input text field CAPS - UPPERCASE

Status
Not open for further replies.

jonperks

Programmer
Nov 19, 2003
40
GB
I have certain text fields that I want to only accept uppercase text, I dont mean that they have to have caps lock on....

I am looking for a way that regardless to if they type with caps lock on or off it gets entered in uppercase?

Hope that makes sense

thanks in advance....
 
stringName.toUpperCase()

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Unfortunately not, as that will convert it once it has been entered, I need it entered in uppercase in the first place, but I cant restrict the user to uppercase letters as I want them to be able to enter the text regardless of them typing with capslock or not.

If I'm wrong please let me know...

Thanks.
 
I've done it by calling the toUpperCase with onClipEvent (enterFrame)

But this seems a little glitchy, flickers a bit...

Is there no better way?
 
Perhaps you should let them type it in lower case and then convert it when the field loses focus? Just a thought. The other thing you could do (in theory) is only embed the uppercase font outlines.

Wow JT that almost looked like you knew what you were doing!
 
what about

my_text.onChanged = function(){
this.text = this.text.toUpperCase()
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top