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
Per Glenn G's comment above, I would use
myVal.enabled = false;
to disable the validator instead of
ValidatorEnable(myVal, false);
Here's what I experienced: Both snippets worked fine on my 2003 server with .net framework 2.0. However, on server 2008 R2 with .net framework 4.0 (I'm not sure which is causing the issue), I was getting unintended behavior with "ValidatorEnable". There are tabs (usercontrols) on my page and when I would leave the tab that was calling "ValidatorEnable", it was temporarily disabling validators on the next tab (even though code was not being called to disable them) until the next postback.