title: Disable textboxes on check changed
body: <p>I have a checkbox that disables 2 textboxes when checked. When it is unchecked it enables the checkboxes. Here is the JavaScript:</p>
  
  <pre><code>function enableField() {
      prePracticeCodeTextBox = document.getElementById('prePracticeCodeTextBox');
      preContactTextBox = document.getElementById('preContactTextBox');
      checkTheBox = document.getElementById('CheckBox1');
      if (checkTheBox.checked == true) {
          prePracticeCodeTextBox.disabled = false;
          preContactTextBox.disabled = false;
  
      }
      else {
          prePracticeCodeTextBox.disabled = true;
          preContactTextBox.disabled = true;
      }
  }
  </code></pre>
  
  <p>Here is the HTML:</p>
  
  <pre><code>&lt;dl&gt;
      &lt;dt&gt;&lt;label for="CheckBox1"&gt;PreAnalytical?&lt;/label&gt;&lt;/dt&gt;
      &lt;dd&gt; &lt;asp:CheckBox ID="CheckBox1" runat="server" CausesValidation="false"
                              Visible="true" OnCheckChanged="enableField()"/&gt;&lt;/dd&gt;
  &lt;/dl&gt;
  &lt;dl&gt;
      &lt;dt&gt;&lt;label for="prePracticeCodeTextBox"&gt;Practice Code:&lt;/label&gt;&lt;/dt&gt;
      &lt;dd&gt;&lt;asp:TextBox ID="prePracticeCodeTextBox" runat="server" Enabled="False" /&gt;&lt;/dd&gt;
  &lt;/dl&gt;
  &lt;dl&gt;
      &lt;dt&gt;&lt;label for="preContactTextBox"&gt;Contact:&lt;/label&gt;&lt;/dt&gt;
      &lt;dd&gt;&lt;asp:TextBox ID="preContactTextBox" runat="server" Enabled="False" /&gt;&lt;/dd&gt;
  &lt;/dl&gt;
  </code></pre>
  
  <p>The JavaScript function is not being called at all.</p>
  
  <p>What am I doing wrong?</p>