You are here: irt.org | FAQ | JavaScript | Form | 10.1 | Q741 [ previous next ]
Try:
<SCRIPT LANGUAGE="JavaScript"><!-- function altered(what) { for (var i = 0;i<5; i++) if (what.sameName[i].checked) what.mySelect.options[i].selected = true; } //--></SCRIPT> <FORM> <SELECT NAME="mySelect"> <OPTION>0 <OPTION>1 <OPTION>2 <OPTION>3 <OPTION>4 </SELECT> <INPUT TYPE="RADIO" NAME="sameName" onClick="altered(this.form)"> <INPUT TYPE="RADIO" NAME="sameName" onClick="altered(this.form)"> <INPUT TYPE="RADIO" NAME="sameName" onClick="altered(this.form)"> <INPUT TYPE="RADIO" NAME="sameName" onClick="altered(this.form)"> <INPUT TYPE="RADIO" NAME="sameName" onClick="altered(this.form)"> </FORM>