title: Performing both client side and server side functions on button click - Specific Scenario
body: <p>I have a checkbox, label and button control.
  If the checkbox is not checked and button is clicked, I need to display a message in label stating to check the checkbox first.
  If the checkbox is checked and then the button clicked, it should allow me to proceed.</p>
  
  <p>This is very similar to the terms and conditions screens,where if you dont check the checkbox - you are not allowed to proceed.</p>
  
  <p>I am using the below javascript. Please let me know how do I accomplish this functionality?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function testCheckbox() {
      var obj = document.getElementById('&lt;%= chkTerms.ClientID %&gt;');
      if (obj.checked == false) {
          document.getElementById("lblCheck").style.visibility = "visible";
          return false;
      }
  }
  &lt;/script&gt;
  &lt;asp:Label ID="lblTerms" runat="server" Text="I agree to the Terms and Conditions"&gt;   &lt;/asp:Label&gt;
  
  &lt;asp:Label ID="lblCheck" runat="server" Text="Please agree to the terms and conditions to proceed"&gt;&lt;/asp:Label&gt;
  
  &lt;asp:Button ID="btnProceed" runat="server" OnClientClick ="return testCheckbox()"   OnClick="btnProceed_Click" Text="Submit" /&gt;
  </code></pre>