/ Published in: VB.NET

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript"> function ValidateCheckBox(sender, args) { if (document.getElementById("<%=chkAcepto.ClientID %>").checked == true) { args.IsValid = true; } else { args.IsValid = false; } } </script> <asp:CheckBox ID="chkAcepto" runat="server" Checked="false" /> <asp:CustomValidator ID="reqCheckBox" runat="server" ErrorMessage="Obligatorio" ClientValidationFunction = "ValidateCheckBox" />
Comments
