Hi,
I want to use radio button to select a textbox, so that when a user click's on a link, depening on which button is currently selected, a value is posted to one of two text boxes.
however IE keeps throwing up an error on line 21/22 (the line of HTML that calls the JS function) What am I missing?
I've posted the code (or as much as is relevent) to explain whats going on (or not)
-----
I want to use radio button to select a textbox, so that when a user click's on a link, depening on which button is currently selected, a value is posted to one of two text boxes.
however IE keeps throwing up an error on line 21/22 (the line of HTML that calls the JS function) What am I missing?
I've posted the code (or as much as is relevent) to explain whats going on (or not)
Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function setbox(myValue){
if (document.myForm.1[1].selected) {
document.box1.value = myValue
}
if (document.myForm.1[2].selected) {
document.box2.value = myValue
}
}
</SCRIPT>
</head>
<body>
<a href="#" onClick="setbox(14)">14</a><br />
<a href="#" onClick="setbox(16)">16</a><br />
<form name=myForm >
<table><tr><td>
<input type="radio" name="1" value="test1" ><br>
</td></tr><tr><td>
<input type="radio" name="1" value="test2" ><br>
</td></tr></table>
</form>
<form name=myForm2 >
<table><tr><td>
<INPUT TYPE="text" NAME="box1" VALUE="">
</td></tr><tr><td>
<INPUT TYPE="text" NAME="box2" VALUE="">
</td></tr></table>
</form>
</BODY>
</HTML>
-----