New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error messages reset with remote-validation #2150
Comments
Thanks a lot for filling this issue! I'll triage and take a look at it as soon as possible! |
Here for the same reason and came across this post. I will try to describe the behavior with this example : rules are : Form loads with no value for 'name' input - the 'date' input has a valid value. I submit the form and the following happens in this order : highlight: function At this point, visually, the 'name' input does not have error classes added to it through the highlight: function even though it should being invalid. Although, the 'errorPlacement: function' has run successfully and I have an error message shown for it. If I submit a second time the following happens : highlight: function and everything is correct (the highlight: function correctly added classes to the 'name' input for being invalid). The only difference here is the remote post and the unhighlight : function after it were not executed because its value never changed - it didn't need to validate. I'll also add, if I view the DOM live, on the initial submit I can see the correct classes are applied to the 'name' input through the highlight: function and then immediately disappear. From what I can tell... it works as it should then the remote post validation happens and any invalid input (whatever was done with the highlight : function) immediately gets reversed when the remote post happens through the unhighlight: function. Looking forward to a solution for this. Been using this plugin for a few years now and love it. I am changing on a few things on one of the sites I use this and noticed this problem happening with the 1.17.0 version. |
I have got just same issue as moeeow95 describe highlight -> unhighlight -> remote -> unhighlight
|
Can we get an update on this? This is a major flaw as it currently stands. |
@morrow95 @ETNyx
Merhod "remote" call
and clean all errors |
Good stuff. Looking forward to this getting pushed in a new release. Thanks! |
SOLUÇÃO NA LINHA COMENTADA //validator.resetInternals(); (SÓ COMENTAR ELA) file: (jquery.validate.js) remote: function( value, element, param, method ) {
} |
Was |--| close to moving to Parsley. Thank god I found this. |
This appears to still be an issue in v1.19.3 that was introduced in v1.15.0. As mentioned above by Discartyptics on Apr 10, 2018, this is the exact issue reported in issue #1907 back in 2016 by thinking2. validator.resetInternals(); SHOULD NOT be fired in the "success" section of the remote rule which is resulting in the clearing of the errorMap/errorList variables. Does anybody actually maintain this code anymore? This issue was reported 6 years ago and the exact fix for it identified 5 years ago. |
@golfmike send a PR. |
Hi, I'm trying to add a unit test to the PR #2242 (initially opened by @leonardospina ) to get it validated. @archer3cl Have you a demo project that show the issue ? I tried to build one and tried to produce the issue by calling the .valid() function, but it didn't show the issue |
I managed to write a case that fail and the test |
Subject of the issue
Error messages resets after remote validation when using the ".valid()" method
Your environment
jquery-validate
: v1.17.0Steps to reproduce
Expected behaviour
It should show the error messages on the corresponding fields
Actual behaviour
It resets the error messages on all the fields
*If I call ".valid()" a second time, it shows the error messages correctly
The text was updated successfully, but these errors were encountered: