Checkbox custom validation in


In this post I will explain how to validate ASP.Net Checkbox control using ASP.Net Custom Validator and JavaScript.


function CheckboxValidation(sender, args) {
            if (document.getElementById("<%=YourCheckboxControlID.ClientID %>").checked == true) {
                args.IsValid = true;
            } else {
                args.IsValid = false;


asp:CheckBox ID="YourCheckboxControlID" runat="server" />

Custom Validator:


Here, You can see the I have used ClientValidationFunction property of CustomValidator. Which is used to validate control by using javascript function. So when I click on the button then it validates the checkbox whether it is is checked or not.

Hope this will help you !!!….

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>