title: Validating against checkbox and aspnet validation
body: <p>I'm using asp.net validation controls which work fine. I've since introduced an HTML checkbox which should be ticked before the form can be submitted.  My function for this reads as follows:</p>
  
  <pre><code>function terms(form) {
  var terms = document.getElementById("chkTerms").checked;
  var errorsArray = new Array();
  
  if (terms == false) {
      //alert("Terms not checked (works)");
      errorsArray.push("You must agree to the terms and conditions.");
      if (errorsArray.length) {
          document.getElementById("termsOutput").innerHTML = errorsArray.join("\n") + "&lt;br /&gt;";
          return false;
      }
  }
  else {
      document.getElementById("termsOutput").innerHTML = "";
  }}
  </code></pre>
  
  <p>It is called as follows:</p>
  
  <pre><code>&lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="return terms(form)" /&gt;
  </code></pre>
  
  <p>The problem I have is seems I can either use the asp.net validation OR the custom checkbox validation I wrote. After the form posts however, the asp.net validation fires!  Anyone know what I'm doing wrong?</p>