I have a form which has drop down boxes or select fields in it. I need that data submitted to be validated as with the other text fields but the usual validation statement does not seem to work. Here is what I have for the javascript: -
if (document.frmClientInfo.REQMONTH.value == "" {
alert("You must fill in 'Month Required' before submitting."
document.frmClientInfo.REQMONTH.focus();
return false;
}
Here is what I have in the HTML: -
<select name="REQMONTH" size="1">
<option value=""></option>
<option value="January">January</option>
The validation always works for a text field but does not work for the dropdown if not selected by my users.
What am I doing wrong? [sig][/sig]
if (document.frmClientInfo.REQMONTH.value == "" {
alert("You must fill in 'Month Required' before submitting."
document.frmClientInfo.REQMONTH.focus();
return false;
}
Here is what I have in the HTML: -
<select name="REQMONTH" size="1">
<option value=""></option>
<option value="January">January</option>
The validation always works for a text field but does not work for the dropdown if not selected by my users.
What am I doing wrong? [sig][/sig]