Handling ASP Validator Control from Jquery

to enable or disable a validator control in an aspx page the last part is boolean true to enable and false to disable

ValidatorEnable(document.getElementById('<%= requiredFieldValidator1.ClientID %>'), false);

an example code , when checked a check particular validator should be disabled on unchecking, it should enable the validator. the code is

$('#<%=chkpt.ClientID %>').click(function() {
           //alert('test');
           var skip = null;

if ($(this).is(‘:checked’) == true) {
// alert(“checked”);
skip = “parametervalidatorfalse”
} else {
skip = “parametervalidatortrue”
//alert(“not checked”);
}

if (skip == “parametervalidatorfalse”) ValidatorEnable(document.getElementById(‘<%= rfv3.ClientID %>’), false);
if (skip == “parametervalidatortrue”) ValidatorEnable(document.getElementById(‘<%= rfv3.ClientID %>’), true);
});

 

thanks to stackoverflow and eggheadcafe