Return to Snippet

Revision: 50860
at September 6, 2011 21:19 by JoseKar


Initial Code
<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" />

Initial URL

                                

Initial Description

                                

Initial Title
Custom validator para validar un checkbox

Initial Tags

                                

Initial Language
VB.NET