PDA

View Full Version : check a button when associated text field is filled in


ventura
10-23-2002, 06:28 PM
how can i check the associated radio button (other) when the text field is filled in with something.

<table>
<!--<span id="buyerIs">-->
<tr>
<td><input type="radio" name="buyerIs" value="agent"></td>
<td colspan="2" class="fontSize10">Agent</td>
</tr>
<tr>
<td><input type="radio" name="buyerIs" value="manager"></td>
<td colspan="2" class="fontSize10">Manager</td>
</tr>
<tr>
<td><input type="radio" name="buyerIs" value="other"></td>
<td class="fontSize10">Other</td>
<!--</span>-->
<td><input id="buyerIsOther" type="text" name="buyerIsOther" value="" onclick="document.form.buyerIs[2].checked == true" /></td>
</tr>
</table>

beetle
10-23-2002, 06:43 PM
Perhaps this instead?

<input id="buyerIsOther" type="text" name="buyerIsOther" value="" onBlur="if (/^\s*$/.test(this.value)) this.form.buyerIs[2].checked = true;" />