<asp:CheckBox ID="CheckBoxTermsandCondition" runat="server" Font-Names="Calibri" Font-Size="Small" ForeColor="Black" /> I Agree with Terms and Condition <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="You Must Agree Upon our terms and condition" ClientValidationFunction = "ValidateCheckBox"></asp:CustomValidator><br /></div>
<script type = "text/javascript"> function ValidateCheckBox(sender, args) { if (document.getElementById("<%=CheckBoxTermsandCondition.ClientID %>").checked == true) { args.IsValid = true; } else { args.IsValid = false; } } </script>
var checked = 0; $("input[type=checkbox]").live("click", function() { if($(this).attr("checked")) checked++; else checked--; } //Then you would be able to test like this. if(checked === 0) { doSomething(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)