BananaQuaalude
10-22-2003, 11:56 AM
Hello,
Is there an equivalent to VBScript's isObject function?
I have a form that displays elements according to server-side VBScript variables. Sometimes not all the elements are displayed on the form. They aren't hidden elements, they simply are not there.
When I go to validate, I want to check to see if the element exists before I make sure it's got coherent data in it.
For instance, I have this function:
function verify() {
if (document.frmDelegate.cboAllEmp1.value == "Select Employee") {
if (document.frmDelegate.cboAllEmp.value == "Select Employee") {
alert("Please choose a delegate for your direct reports")
document.frmDelegate.cboAllEmp.focus
return false;
}else if (document.frmDelegate.txtApproved.value == "") {
alert("Please choose at least one direct report to delegate, \n or click Cancel to exit")
return false;
}
}
}
cboAllEmp1 is not always there. What I'm looking for is a way to test to see if it is indeed an object before I try to see what its value is.
thanks!
Is there an equivalent to VBScript's isObject function?
I have a form that displays elements according to server-side VBScript variables. Sometimes not all the elements are displayed on the form. They aren't hidden elements, they simply are not there.
When I go to validate, I want to check to see if the element exists before I make sure it's got coherent data in it.
For instance, I have this function:
function verify() {
if (document.frmDelegate.cboAllEmp1.value == "Select Employee") {
if (document.frmDelegate.cboAllEmp.value == "Select Employee") {
alert("Please choose a delegate for your direct reports")
document.frmDelegate.cboAllEmp.focus
return false;
}else if (document.frmDelegate.txtApproved.value == "") {
alert("Please choose at least one direct report to delegate, \n or click Cancel to exit")
return false;
}
}
}
cboAllEmp1 is not always there. What I'm looking for is a way to test to see if it is indeed an object before I try to see what its value is.
thanks!