Hi, I need help with a form.
I have a rather long form that already has an onsubmit function to check for required fields. But now my client wants something I’m not sure how to do.
We have 4 radio buttons. If either of 2 of them are checked, my client wants to require that a text field is filled out.
The form part is:
[code=html]<table border=”0″ cellpadding=”2″ style=”border-collapse: collapse” id=”table3″ cellspacing=”2″ width=”100%”>
<tr>
<td align=”center”>
<p align=”left”><b>Shipped</b></td>
<td align=”center” width=”393″>
<p align=”left”><b>E-Mailed</b></td>
</tr>
<tr>
<td>
<input type=”radio” name=”Fee” value=”$150.00 1 Loan – Shipping Documents” tabindex=”28″>1
Loan $150.00</td>
<td width=”393″>
<input type=”radio” name=”Fee” value=”$200.00- 1 Loan by Email” tabindex=”30″>1
Loan $200.00</td>
</tr>
<tr>
<td>
<input type=”radio” name=”Fee” value=”$225.00 – 2 Loans- Shipping Documents” tabindex=”29″>2
Loans (1st & 2nd) $225.00</td>
<td width=”393″>
<input type=”radio” name=”Fee” value=”$300.00 – 2 Loans by Email” tabindex=”31″>2
Loans (1st & 2nd) $300.00</td>
</tr>
<tr>
<td>
<b>Return Documents to Address:<font color=”#FF0000″><br>
(Required for E-mailed Docs)</font></b></td>
<td width=”393″>
<textarea name=”Return_Docs_Address” rows=”3″ cols=”29″ tabindex=”32″ wrap=”virtual” onblur=”Substitute();”></textarea></td>
</tr>
<tr>
<td>
<font color=”#FF0000″><b>Return via</b></font></td>
<td width=”393″>
<input type=”radio” name=”Return_Via” value=”FedEx” tabindex=”33″ checked>Fed
Ex
<input type=”radio” name=”Return_Via” value=”UPS” tabindex=”34″>UPS </td>
</tr>
<tr>
<td>
<font color=”#FF0000″><b>FedEx/UPS Account #</b></font></td>
<td width=”393″>
<strong>
<input type=”text” size=”33″ maxlength=”256″ name=”Shipping_Account_No” tabindex=”35″></strong></td>
</tr>
</table>
If the radio “Fee” is checked for either of the Email options ($300.00 – 2 Loans by Email, or $200.00- 1 Loan by Email). Then he wants the “Return_Docs_Address” and “Shipping_Account_No” required.
Any ideas??
Thanks for any help you can give.
Robyn