Javascript Validation
I have 3 similar rows with 3 columns, one is dropdown box and other two are textarea. I want the users to enter atleast 1 set of it. The rest of 2 is fine if they dont enter.
Suppose they select the value from dropdown and didnot enter anything in both text area, than on submit it shuld alert error message.
Same thing shuld happen if the users enter in one text area and havenot enter or selected from dropdown box and another textarea.
Here is my code.
<tr>
<td valign="top" width="4%">1</td>
<td valign="top" width="3%">
<select name="local[]">
<option selected value="">Select...</option>
<option value="Local">Local</option>
<option value="Central">Central</option>
</select></td>
<td width="10%"><textarea rows="5" cols="30" name="duties[]">
</textarea></td><td width="10%"><textarea rows="5" cols="30" name="skill[]">
</textarea></td>
</tr>
<tr>
<td valign="top" width="4%">2</td>
<td valign="top" width="3%">
<select name="local[]">
<option selected value="">Select...</option>
<option value="Local">Local</option>
<option value="Central">Central</option>
</select></td>
<td width="10%"><textarea rows="5" cols="30" name="duties[]">
</textarea></td><td width="10%"><textarea rows="5" cols="30" name="skill[]">
</textarea></td>
</tr>
<tr>
<td valign="top" width="4%">3</td>
<td valign="top" width="3%">
<select name="local[]">
<option selected value="">Select...</option>
<option value="Local">Local</option>
<option value="Central">Central</option>
</select></td>
<td width="10%"><textarea rows="5" cols="30" name="duties[]">
</textarea></td><td width="10%"><textarea rows="5" cols="30" name="skill[]">
</textarea></td>
</tr>