Hi All,
I am a novice when it comes to javascript so this may be very simple. In the code below, I want to be sure parent.main.document.forms[0].w_customer exists before the code executes. We use frames for our app and sometimes main is a but slow to load. When that happens we get the error "parent.main.document.forms[0].w_customer is null or not an object". How can I check to make sure parent.main.document.forms[0].w_customer is an object?
function chgfocus() {
if (***CODE TO GO HERE***) {
if (parent.main.document.forms[0].w_customer.value == '')
parent.main.document.forms[0].w_customer.focus();
else
parent.oetoolbar.document.forms[0].w_part.focus();
}
}
I am a novice when it comes to javascript so this may be very simple. In the code below, I want to be sure parent.main.document.forms[0].w_customer exists before the code executes. We use frames for our app and sometimes main is a but slow to load. When that happens we get the error "parent.main.document.forms[0].w_customer is null or not an object". How can I check to make sure parent.main.document.forms[0].w_customer is an object?
function chgfocus() {
if (***CODE TO GO HERE***) {
if (parent.main.document.forms[0].w_customer.value == '')
parent.main.document.forms[0].w_customer.focus();
else
parent.oetoolbar.document.forms[0].w_part.focus();
}
}