javascript: convert input text to upper or lower case

by prettyscripts on 2007-12-08 00:41:00

javascripthtml

to convert to upper case, add onChange to <input> and call oUpperCase() function:

<input type="text" onChange="javascript:this.value=this.value.toUpperCase();" />

to convert to lower case:

<input type="text" onChange="javascript:this.value=this.value.toLowerCase();" />

Tags: case, input, javascript

No feedback yet

Leave a comment


Your email address will not be revealed on this site.
PoorExcellent
note: all comments are moderated. do not spam and do not advertise. only comments relevant to the post will be published.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)