Forum Moderators: open
function confirm_Neighborhood()
{
// Check to see if the dropdown value is is the first choice
if (dropdown.Neighborhood.selectedIndex == 0)
{
// If the first choice is selected display an alert box
// stating the first choice is not a valid selection
alert("Please select your neighborhood.");
// Focus on the dropdown menu after OK is clicked from the alert box
dropdown.Neighborhood.focus();
return (false);
}
// A choice other than the first was selected
// cotinue processing the form request
return (true);
}
And here is the HTML that calls it:
<form name="dropdown" method="post" action="http://www.mydomain.com/cgi-bin/bizmail.cgi" onsubmit="return confirm_Neighborhood()">
My question (and hopefully a simple one), how do I duplicate this for other drop down boxes I want to add to the form? If the answer is to duplicate the function with the different variable names, then how do I call it? Add another "onsubmit"?
I'm new at this so, be easy on me! ;)