Changes

Changing Text to Uppercase or Lowercase

189 bytes added, 18:27, 9 June 2009
no edit summary
'''To convert entered text to Uppercase
<pre>
onChange="javascript:this.value=this.value.toUpperCase();"
</pre>
'''To convert entered text to lowercase
<pre>
onChange="javascript:this.value=this.value.toLowerCase();"
</pre>
The code gets executed as soon as the user enters a value and clicks anywhere outside the field (even without having to hit SAVE).
 
You can also use onBlur instead of onChange
onblur="this.value=this.value.toUpperCase()"
 
* onBlur runs when the focus moves away from the current field
* onChange runs when the content of the field has changed
[[Category:Custom Fields]][[Category:JavaScript Examples]]
0
edits