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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert input field to uppercase 1

Status
Not open for further replies.

NewBear

Programmer
Jul 30, 2003
6
0
0
HK
I have find that we can use style- text-transform:uppercase to force user to input uppercase. But the inputted data doesn't converted. Can we use css-style to change it ?

I find a style- font-variant : small-caps, it seems like the text-transform but someone get different result (the entered value convert to uppercase but input still show lowercase). What's it done ?

NewBear


 
<input type=text style=&quot;text-transform:uppercase;&quot;>
This works fine, at least in IE.
 
<input type=&quot;text&quot; onchange=&quot;this.value=this.value.toUpperCase();&quot;>

Works in all current browsers.
 
this.value=this.value.toUpperCase(); is javascript... so it won't sork if java script is off. Also, why use my machines resources to do it, it's your site so you do the work. I'm really not that anti-javascript, and for that it'd be fine, but it seems to me that the best thing to do would use the CSS and make sure nothing slid by with a check for it, when you processes the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top