In this article I will explain how to enable disable ASP.Net Validator (Client Side Validation) such has RequiredField validator, RegularExpression validator, Custom validator, etc. using JavaScript or jQuery.
In order to enable or disable ASP.Net Validator (Client Side Validation), we need to make use of the inbuilt ValidatorEnable ASP.Net client side JavaScript function.
 
You might also like to read:
 
Enable Disable ASP.Net Validators (Client Side Validation) using JavaScript
The HTML Markup consists of an ASP.Net TextBox, a CheckBox to enable or disable the validation when it is checked or unchecked respectively and a Button to trigger the RequiredField Validator for the TextBox.
UserName:
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="valName" ControlToValidate="txtName" runat="server"
    ErrorMessage="*Required" ForeColor="Red" ValidationGroup="Group1" />
<br />
Enable Validation:
<input type="checkbox" id="CheckBox1" onclick="ToggleValidator(this);" checked="checked" />
<br />
<asp:Button Text="Submit" runat="server" ValidationGroup="Group1" />
<script type="text/javascript">
    function ToggleValidator(chk) {
        var valName = document.getElementById("<%=valName.ClientID%>");
        ValidatorEnable(valName, chk.checked);
    }
</script>
 
The RequiredField Validator for the TextBox can be enabled or disabled by checking or unchecking the CheckBox respectively.
When the CheckBox is clicked the ToggleValidator JavaScript function is executed. Inside this function we first check whether the CheckBox is checked or unchecked and based on its state we either enable or disable the RequiredField Validator valName using the ValidatorEnable JavaScript function.
 
 
Enable Disable ASP.Net Validators (Client Side Validation) using jQuery
The HTML Markup consists of an ASP.Net TextBox, a CheckBox to enable or disable the validation when it is checked or unchecked respectively and a Button to trigger the RequiredField Validator for the TextBox.
Email:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="valEmail" ControlToValidate="txtEmail"
    runat="server" ErrorMessage="*Required" ForeColor="Red" ValidationGroup="Group2" />
<br />
Enable Validation:
<input type="checkbox" id="CheckBox2 checked="checked" />
<br />
<asp:Button Text="Submit" runat="server" ValidationGroup="Group2" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    $(document).on("click", "#CheckBox2", function () {
        var valEmail = $("[id*=valEmail]");
        ValidatorEnable(valEmail[0], $(this).is(":checked"));
    });
</script>
 
The RequiredField Validator for the TextBox can be enabled or disabled by checking or unchecking the CheckBox respectively.
A jQuery Click event handler has been assigned to the CheckBox, thus when the CheckBox is clicked, we first check whether the CheckBox is checked or unchecked and based on its state we either enable or disable the RequiredField Validator valEmail using the ValidatorEnable JavaScript function.
Enable Disable ASP.Net Validator (Client Side Validation) using JavaScript or jQuery
 
Demo
 
Downloads