Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set item focus from javascript

JoLSep 3 2008 — edited Sep 4 2008
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2008
Added on Sep 3 2008
7 comments
2,819 views