How to reset ASP.NET MVC client validation mode?
- by Morten Christiansen
I'm having a bit of trouble with the client-side validation in the ASP.NET MVC 2 framework and hope someone can help me out.
In several situations I find it useful to be able to reset the contents of a form or just a single input element and I need any validation errors to disappear. This in itself is not very hard, and the suggestion provided here works well enough:
http://stackoverflow.com/questions/2798427/how-do-i-clear-mvc-client-side-validation-errors-when-a-cancel-button-is-clicked
The problem is that, when triggered, client validation goes into an aggressive mode that performs validation on each key press and when an input loses focus. Is there a good way to reset this state as well?