Disabling ASP.NET Validators via Client Side Javascript

January 24, 2011 at 9:35 PMFred Mastro

I had the need to disable my asp.net expression validator when some other client side events fired a post back.

 

Here’s the snippet if you need it.

function specialClientSideToDo()
{
  var reValidator= document.getElementById('<%=reValidator.ClientID%>');
  ValidatorEnablereValidator, false); 
}

 

Later I re-enable after I’m done doing whatever I had to do.

Posted in: JavaScript | ASP.NET

Tags: