Hi everyone,
I have a form that is used for registering for a conference. There is an early bird special (member or non-member), regular registration (member or non-member), and on-site (member or non-member).
I would like for the form to function like this. If the user selects the early bird special for member (at 100.00) it populates the text field with the value for that row. Or, if the user selects regular registration for non-member it sets the early bird text field back to 0.00 and populates the text field with he value for the regular expression code. At the same time it populates the total field with the total price. I hope this makes sense.
How can I accomplish this using JavaScript or jQuery? The text fields are read only. Thank you in advance! The table is listed below.
Table code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="50%" border="1" cellspacing="0" cellpadding="0">
<tr>
<th width="57%" scope="col"> </th>
<th width="14%" scope="col">Member</th>
<th width="17%" scope="col">Non-Member</th>
<th width="12%" scope="col">Total</th>
</tr>
<tr>
<td class="highlight"><strong>Early Bird:</strong></td>
<td class="highlight"><div align="center"><input id="early-bird" type="radio" name="price" value="100.00" class="required" title="Please choose a rate package" /> $100.00</div></td>
<td class="highlight"><div align="center"><input id="early-bird" type="radio" name="price" value="125.00" /> $125.00</div></td>
<td class="highlight"><div align="center"><input type="text" class="text extra-sm" style="text-align:center;" id="early-bird-total" name="early-bird-total" size="6" value="0.00" readonly /></div></td>
</tr>
<tr>
<td><strong>Regular Registration:</strong></td>
<td><div align="center"><input id="regular" type="radio" name="price" value="125.00" /> $125.00</div></td>
<td><div align="center"><input id="regular" type="radio" name="price" value="250.00" /> $250.00</div></td>
<td><div align="center"><input type="text" class="text extra-sm" style="text-align:center;" id="regular-total" name="regular-total" size="6" value="0.00" readonly /></div></td>
</tr>
<tr>
<td><strong>On-Site:</strong></td>
<td><div align="center"><input id="on-site" type="radio" name="price" value="250.00" /> $250.00</div></td>
<td><div align="center"><input id="on-site" type="radio" name="price" value="275.00" /> $275.00</div></td>
<td><div align="center"><input type="text" class="text extra-sm" style="text-align:center;" id="on-site-total" name="on-site-total" size="6" value="0.00" readonly /></div></td>
</tr>
<tr>
<td colspan="3" align="right"><strong>TOTAL:</strong></td>
<td><div align="center"><input type="text" class="text extra-sm" style="text-align:center;" id="total-amt" name="total-amt" size="6" value="0.00" readonly /></div></td>
</tr>
</table>
</body>
</html>
mz