I have a dynamically created page that creates a bunch of select boxes (dropdowns) all named the same thing. When the user submits the page I need to validate the page and make sure that none of the select boxes still have the default value (99999). The problem is I am not sure how to cycle through the dropdowns. Here is my code below. Please note that the code for the 'title' textboxes (that have been created the same way) works just fine.
for (i = 0; i < arraycount; i++)
{
if (form.title.value == "")
{
alert ("You can't leave any titles empty.");
return false;
}
}
for (i = 0; i < arraycount; i++)
{
if (form.category.options[form.category.selectedIndex].value == "99999")
{
alert ("You must choose a category for each award.");
return false;
}
}
Thanks for any and all help in advance.
-Rory
for (i = 0; i < arraycount; i++)
{
if (form.title.value == "")
{
alert ("You can't leave any titles empty.");
return false;
}
}
for (i = 0; i < arraycount; i++)
{
if (form.category.options[form.category.selectedIndex].value == "99999")
{
alert ("You must choose a category for each award.");
return false;
}
}
Thanks for any and all help in advance.
-Rory