
Originally Posted by
Jus S
How do I use anonymous functions to create an input field that converts the value into uppercase onblur()?
research the .toUpperCase()
function
Code:
var a = "this is some text";
a.toUpperCase()
/* will give you -- THIS IS SOME TEXT */
to take that and make a function to use in a script
Code:
function convertToUpper(str, el)
{
document.getElementById(el).value = str.toUpperCase();
}
Code:
<input type="text" name="_something_" id="_id_" value="" onblur="javascript:convertToUpper(this.value, '_id_')">
Bookmarks