Hello,
I am using a fully functional dhtmlxForm and I want to use toUpperCase() onblur on every input field but I am getting a message "Cannot call method ‘toUpperCase’ of undefined " so I tried an alert() which from what I saw fires when the page loads.
I am calling addOnBlur() after the form constructor.
Any suggestions?
[code]function addOnBlur(){
myForm.forEachItem(function(id){
if (myForm.getItemType(id) == “input”) {
var inp = myForm.getInput(id);
inp.onblur=doUpperCase(id);
}
});
}
function doUpperCase(id){
myForm.setItemValue(id,myForm.getItemValue(id).toUpperCase());
}[/code]
function addOnBlur(){
myForm.forEachItem(function(id){
if (myForm.getItemType(id) == "input") {
var inp = myForm.getInput(id);
inp.onblur=alert();
}
});
}