rowantrimmer123
06-11-2009, 03:01 PM
Hello,
I have 2 radio buttons and I need to write a script that checks that 1 of the 2 radio buttons has been checked as they cannot both be unchecked.
My html for the form is as follows...
<tr>
<td colspan="2" class="formname"><b><span style="COLOR: red">*</span>Are you a Parent?</b> <input name="person" type="radio" value="1" /></td>
</tr>
<tr>
<td colspan="2" class="formname"><b><span style="COLOR: red">*</span>Are you a Teacher?</b> <input name="person" type="radio" value="2" /></td>
</tr>
I would really appreciate the code for the javascript.
Kind Regards
Rowan
I have 2 radio buttons and I need to write a script that checks that 1 of the 2 radio buttons has been checked as they cannot both be unchecked.
My html for the form is as follows...
<tr>
<td colspan="2" class="formname"><b><span style="COLOR: red">*</span>Are you a Parent?</b> <input name="person" type="radio" value="1" /></td>
</tr>
<tr>
<td colspan="2" class="formname"><b><span style="COLOR: red">*</span>Are you a Teacher?</b> <input name="person" type="radio" value="2" /></td>
</tr>
I would really appreciate the code for the javascript.
Kind Regards
Rowan