title: Enable/Disable submit button if checkbox is checked/unchecked?
body: <p>How to enable the submit button in my HTML form and disable if checkbox was unchecked?</p>
  
  <p>What is wrong with this code?</p>
  
  <pre><code>EnableSubmit = function(val)
  {
      var sbmt = document.getElementById("Accept");
  
      if (val.checked == true)
      {
          sbmt.disabled = false;
      }
      else
      {
          sbmt.disabled = true;
      }
  }                       
  </code></pre>
  
  <p>The check box</p>
  
  <pre><code>&lt;td width="30%"&gt;Do you accept Terms of Service agreement?&lt;/td&gt;
  &lt;td width="10px" style="min-width: 10px"&gt;&lt;/td&gt;
  &lt;td width="70%"&gt;
      &lt;input type="checkbox" name="TOS" value="Accept" onClick="EnableSubmit"&gt; I agree to Terms of Service agreement.
  &lt;/td&gt;
  </code></pre>