title: Radio button value in VBS
body: <p>I'm trying to read the value of a radio button in VBS and I am coming up with the following error:</p>
  
  <p><strong>Type mismatch: 'phase'</strong></p>
  
  <p>I am getting this error after I've put the radio buttons in a form in order to enable/disabled the checkbox depending on the first radio button.</p>
  
  <p>Any help much appreciated!</p>
  
  <p>MY CODE (not the whole code, just the faulty part. Sub RunScript is ran by a button):</p>
  
  <pre><code>&lt;head&gt;
  &lt;/head&gt;
  
  &lt;SCRIPT LANGUAGE="VBScript"&gt;
  
  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
  
  
  &lt;/SCRIPT&gt;
  
  &lt;body&gt;
  &lt;form name="phaseform" action="" &gt;
  &lt;input type="radio" name="phase" value="1" id="phase" onclick="checkbox(0)"/&gt;&lt;label for="phase1"&gt;Phase 1&lt;/label&gt;
  &lt;input disabled id=inorout type="checkbox" name="InorOUT" value="IN"&gt;LEGAL HOLD (&lt;a href=javascript:RunLogFile()&gt;?&lt;/a&gt;) &lt;br&gt;
  input type="radio" name="phase" value="2" id="phase" onclick="checkbox(1)" /&gt;&lt;label for="phase2"&gt;Phase 2 (after 17 days)&lt;/label&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function checkbox(val)
  {
      if(val)
  document.phaseform.InorOUT.setAttribute("disabled",val)
  else
  document.phaseform.InorOUT.removeAttribute("disabled",val)
  }
  &lt;/script&gt;
  
  &lt;/BODY&gt;
  </code></pre>