Radio Buttons Toggle Textbox value

[Total: 0    Average: 0/5]

This example toggles the value of the text box form value.

Body Code:

<form name=exf1>
<input type=text name=t1 value="5">
<BR>
<input name="r1" type="radio" value="5" checked onclick="doIt(5)">5
<input name="r1" type="radio" value="10" onclick="doIt(10)">10
</form>
<script>
function doIt(_v) {
document.exf1.t1.value=_v;
}
</script>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *