title: Checkbox Required Validator
body: <p>I have developing an app in asp.net, on my page there is checkbox which is required field and I code following validation but on pressing save validation is not calling.</p>
  
  <pre><code>&lt;asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate."
                          Font-Bold="true" /&gt;
                      &lt;asp:CustomValidator ID="Custom1"  CssClass="errorTop" ClientValidationFunction="CheckBoxValidation" runat="server"
              ErrorMessage="You must select this box to proceed" &gt;&lt;/asp:CustomValidator&gt; 
  </code></pre>
  
  <p>and the save button code is</p>
  
  <pre><code>   &lt;asp:Button ID="BtnSaveMiscDetail" ValidationGroup="AddMisc" CssClass="buttonGrid"
                              runat="server" Text="Save" Width="60px" OnClick="BtnSaveMiscDetail_Click" /&gt;
  </code></pre>
  
  <p>Client Side Validation code is </p>
  
  <pre><code>function CheckBoxValidation(oSrouce, args) {
          var myCheckBox = document.getElementById("ContentPlaceHolder1_MiscDetails1_ChkContent");
  
          if (myCheckBox.checked) {
  
              args.IsValid = true;
  
          }
          else
              args.IsValid = false;
  
      }
  </code></pre>
  
  <p>validation function is not calling.</p>