Page

Javascript validation code to make sure that checkbox is marked


// Default.aspx //

  <asp:CheckBox ID="chkd" runat="server" 
            style="z-index: 1; left: 86px; top: 917px; position: absolute; width: 717px; height: 21px;" 
                  
                Text="I affirm that i have read and agree to the sourcecodernp.blogspot.com Privacy policy and Terms &amp; Conditions"  />
    
        <asp:Button ID="Button1" runat="server" BackColor="Red" Font-Bold="True" 
            ForeColor="White" 
            style="z-index: 1; left: 217px; top: 978px; position: absolute; width: 146px; height: 42px" 
            Text="Verify &amp; Register"   
           
        onclientclick="return userValid();" />


// Java Script Code  //


 <script type="text/javascript">
        function userValid() {
            
          var chkd;
  chkd = document.form1.chkd.checked;
    if (chkd == true) 
{  }
  else {
   alert("Please Confirm sourcecodernp.blogspot.com Privacy policy and Terms and Conditions")
                 }
            
  return true;
}
                    

</script>

   
       

No comments:

Post a Comment