I have a function that pulls the form element names on submit to validate the fields. The form is built dynamically so I don't know which of the 58 element names might be on the form. I'm looping through the element array to pull the name, then checking if the value has data. This works like a charm in IE but (of course) not in Netscape. I get an error stating "missing variable name" indicating the int variable I thought I declared:
var int = eval('document.forms[0].'+FieldName);
Here's the code
Thanks,
JoliM
var int = eval('document.forms[0].'+FieldName);
Here's the code
Code:
for (i = 0; i < document.forms[0].elements.length; i++) {
var FieldName = document.forms[0].elements[i].name;
var int = eval('document.forms[0].'+FieldName);
if(int.value!=''){
then do stuff
}
}
JoliM