How to reset ASP.NET MVC client validation mode?
Posted
by Morten Christiansen
on Stack Overflow
See other posts from Stack Overflow
or by Morten Christiansen
Published on 2010-06-09T08:26:41Z
Indexed on
2010/06/09
8:32 UTC
Read the original article
Hit count: 494
asp.net-mvc
|client-side-validation
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?
© Stack Overflow or respective owner