Categories
asp.net javascript validation

Disable ASP.NET validators with JavaScript

Does anyone know how to disable an ASP.NET validator using JavaScript?
I’m using javascript style.display = ‘none’ to disable parts of a web page. However these disabled parts have asp.net validators that are still firing and I need to disable then without doing a round trip to the server.
Thanks.

Use this snippet:

function doSomething()
{
var myVal = document.getElementById('myValidatorClientID');
ValidatorEnable(myVal, false);
}