asp.net mvc 3 - How to determine why unobtrusive validation is not working -
What determines why the controversial verification is not being run?
I posted all my custom Validators, and just using MVC validators, and still when I clicked back to the server for verification.
This is driving me crazy. The only thing I can think of is that I have a hidden input on Javascript function to determine which fields are submitting the form Can put a breakpoints? EDIT: I realize that only IE8 is generating server side validation. IE9, FF, and Chrome are all okay Edit 2: Okay, this would be a problem or something like cash, at some point it started working again, and it still restores everything Even after working. Learn Less If you get confused problems, clear yourself. Ensure that you have given the following script reference and the path is correct: And you have enabled client-side validation in your web.config: In addition the firebug console can be useful, showing potential JavaScript errors with your code. [HiddenInput (DisplayValue = false) .
& lt; Script src = "@ Url.Content (" ~ / scripts / jquery.validate.js ")" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "@ Url.Content (" ~ / script / jquery.validate.unobtrusive.js ")" type = "text / javascript" & gt; & Lt; / Script & gt;
& lt; Add key = "ClientValidationEnabled" value = "true" /> Another important aspect is that if the form is injected into the DOM as a result of Axax call, contradictory validity will not be related to its elements and it will not work. In your Axx Success Callback, after injection in DOM, you will get a
$. Validator.unobtrusive.parse will use the method.
Comments
Post a Comment