How to set item focus from javascript
JoLSep 3 2008 — edited Sep 4 2008Hi all,
i need to validate a form item with javascript to check required fields.
The function is :
function isRequired(field) {
if ($v_IsEmpty(field)) {
alert('The field is required!');
html_GetElement(field).focus();
return false;
}
return true;
}
Also in the form item attribute i added :
onChange="isRequired(this);"
If the filed is null, i see the alert but the focus is on the next item! How can i set the focus on the null item?
Thanks,
Sergio