<head>
<script language="vbscript">
sub radio1_onclick()
if document.formname.radio1.selected=true then
document.formname.radio2.enabled=false
....
end if
end sub
</script>
<body>
<form name="formname">
<input type="radio" name="radio1" >
</form>
</body>
我只会用vb写这个程序!
</head>
各位大哥,我是这样写的,为什么实现不了?input是Form的name,radioy和radion是两组radio的id,它们的name是一样的,radiom是我要disable掉的一组radio
<script language=vbscript>
Function ClickedRadioy()
if input.radioy.checked then
input.radiom.disabled =true
end if
if input.radion.checked then
input.radiom.disabled =false
end if
</script>
然后在<input type="radio" value="oy" checked name="lib" id=radioy onclick=ClickedRadioy()>中调用。
首先把radio1和radio2以及所控制的元素放在form表单中,form的名字为:formtest
定义radio1和radio2的id 分别为R1,R2 ;edittext的name=edittext1;其他的radio 的id=Rn
然后通过脚本进行判断:
<script language=vbscript>
Function R1_onClick()
If formtest.R1.selected Then
fromtest.edittext1.disabled=false
fromtest.Rn.disabled=false
Else
fromtest.edittext1.disabled=true
fromtest.Rn.disabled=true
End
End Function
</script>
Radio2的做法同上,但是要把是false的元素变成true即可。