I am setting up a simple javascript dropdown validation system. There is the potential to have mulitple drop down lists in the form.
What I need, is for javascript to validate all dropdown lists reguardless of their name. The lists are generated dynamically in PHP and the names are generated dynamically as well.
Here's what I got, and I just need it to validate every list:
Code:
function validateForm(objForm)
{
var returnStatus = 1;
if (objForm.myfield.selectedIndex == 0) {
alert("My Error!");
returnStatus = 0;
};
if (returnStatus) {
objForm.submit();
}
}