<form name='form1'>
<INPUT type='radio' name='radio1' value='A' onClick="Javascript:change_radio2('A');">A
<INPUT type='radio' name='radio1' value='B' onClick="Javascript:change_radio2('B');">B
<BR>
<INPUT type='radio' name='radio2' value='1'>1
<INPUT type='radio' name='radio2' value='2'>2
<INPUT type='radio' name='radio2' value='3'>3
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
function change_radio2(kind){
frm = document.form1;
if ( kind == 'A'){
frm.radio2[0].disabled = false;
frm.radio2[1].disabled = false;
frm.radio2[2].disabled = true;
frm.radio2[0].checked = true;
}else{
frm.radio2[0].disabled = true;
frm.radio2[1].disabled = true;
frm.radio2[2].disabled = false;
frm.radio2[2].checked = true;
}

}
//-->
</SCRIPT>
반응형