dcsimg
How do I check for existence of a FORM field using JavaScript?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abhishek_Vijaygopal
Posted On:   Tuesday, December 16, 2003 04:08 AM

I need to validate contents of some FORM fields in a loop using Javascript. The field names are in a alphanumeric sequence, and so I am using a loop for the same.



In case some field names which come in the middle do not exist, how can I check if they exist or not using Javascript, prior to validating their content



Pls help.

Abhishek

Re: How do I check for existence of a FORM field using JavaScript?

Posted By:   The_Dude  
Posted On:   Tuesday, December 16, 2003 08:06 AM


var form = document.forms[0];

for (var i = 0; i < alpha.length; i++) {
if (typeof(form.elements[alpha[i]) == "object") {
validateElement(form.elements[alpha[i]);
}
}
About | Sitemap | Contact