dominicall
09-13-2002, 12:42 PM
Hi All - hope someone can help with this...
Am building a search form for a database that allows users to search multiple geographic areas using free text in text boxes. I have 8 text boxes - each with the same name - 'area'.
The form validation takes place on submit thru a included script file. I've sorted out all my form validation for check boxes, radio buttons, etc.... but am now a bit stumped. How do I loop through the 8 text boxes to check that at least 1 has been used and 'return false' when validating the form????
I'm more of a VB/ASP/SQL programmer and have struggled with getting a working validation in javascript for this.
The code from the form is below:
<tr>
<td width="20%"><div class="header" align="left">Areas</div></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
Any help would be greatly appreciated.
Thanks
Dominic
:confused:
Am building a search form for a database that allows users to search multiple geographic areas using free text in text boxes. I have 8 text boxes - each with the same name - 'area'.
The form validation takes place on submit thru a included script file. I've sorted out all my form validation for check boxes, radio buttons, etc.... but am now a bit stumped. How do I loop through the 8 text boxes to check that at least 1 has been used and 'return false' when validating the form????
I'm more of a VB/ASP/SQL programmer and have struggled with getting a working validation in javascript for this.
The code from the form is below:
<tr>
<td width="20%"><div class="header" align="left">Areas</div></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
<tr>
<td width="20%"> </td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
<td width="40%"><input type="Text" name="area" maxlength="20" size="20"></td>
</tr>
Any help would be greatly appreciated.
Thanks
Dominic
:confused: