我正在尝试读取 VBS 中单选按钮的值,但出现以下错误:
类型不匹配:“阶段”
在将单选按钮放入表单以根据第一个单选按钮启用/禁用复选框后,我收到此错误。
非常感谢任何帮助!
我的代码(不是整个代码,只是有缺陷的部分。Sub RunScript 由一个按钮运行):
<head>
</head>
<SCRIPT LANGUAGE="VBScript">
Sub RunScript
Dim currentphase
If phase(0).Checked Then
currentphase = phase(0).Value
End If
If phase(1).Checked Then
currentphase = phase(1).Value
End If
If currentphase = "" Then
MsgBox "Please select the phase.",48,"Error"
Exit Sub
End If
End Sub
</SCRIPT>
<body>
<form name="phaseform" action="" >
<input type="radio" name="phase" value="1" id="phase" onclick="checkbox(0)"/><label for="phase1">Phase 1</label>
<input disabled id=inorout type="checkbox" name="InorOUT" value="IN">LEGAL HOLD (<a href=javascript:RunLogFile()>?</a>) <br>
input type="radio" name="phase" value="2" id="phase" onclick="checkbox(1)" /><label for="phase2">Phase 2 (after 17 days)</label>
</form>
<script type="text/javascript">
function checkbox(val)
{
if(val)
document.phaseform.InorOUT.setAttribute("disabled",val)
else
document.phaseform.InorOUT.removeAttribute("disabled",val)
}
</script>
</BODY>