narino
05-11-2010, 05:54 AM
Dear all
I know this must be so easy for you guys, but I was unable to find the answer. Please help.
I wrote this form to try to display the value of the chosen radio button on a text input.
<form>
Choose one choice...
<input type="radio" name="group1" value="5">Five<br>
<input type="radio" name="group1" value="10">Ten<br>
<input type="button" value="Get Result!" onClick="T1.value=group1.value"><br>
Your choice is
<input type="text" size="2" value="0" name="T1">
</form>
How come the onClick="T1.value=group1.value" results in undefined instead of 5 (or 10) ?
How do I fix it?
Thanks a lot,
Narin
I know this must be so easy for you guys, but I was unable to find the answer. Please help.
I wrote this form to try to display the value of the chosen radio button on a text input.
<form>
Choose one choice...
<input type="radio" name="group1" value="5">Five<br>
<input type="radio" name="group1" value="10">Ten<br>
<input type="button" value="Get Result!" onClick="T1.value=group1.value"><br>
Your choice is
<input type="text" size="2" value="0" name="T1">
</form>
How come the onClick="T1.value=group1.value" results in undefined instead of 5 (or 10) ?
How do I fix it?
Thanks a lot,
Narin