Jquery validation remote depends verification trigger condition, jqueryvalidation
Background:
1: data modification page;
2: email cannot be repeated
On the modify page, the mailbox is taken out by default, but the field has remote verification, which cannot be repeated. If the focus is lost in the mailbox input box, remote verification is triggered by default,
Introduction complete
Solution:
Remote verification is not triggered when the mailbox does not change;
After turning over the issues plug-in on github, you can see an article https://github.com/jzaeffer/jquery-validation/issues/431,the idea of a perfect solution,
email:{required : true,email : true,maxlength : 100,remote : {depends : function(element) { return element.value !== "${client.email}"; },param : {url : "${ctx}/account/checkEmail",cache :false}}}
Jquery validation remote verifies Email. The returned value is correct, but the error message is unrealistic.
Wrong understanding
When jquery validation remote returns true, it indicates the result is successful, so no prompt is displayed.
For example, if the input is a test@example.com, the returned false will prompt Already subscribed.
Why does jquery-validation remote only return True false and no error message is displayed?
Have you set message for remote. Like this:
Rules: {"oauser. ssourl": {required: true, url: true, remote: "user/user! CheckUrl. action "}}, messages: {" oauser. ssourl ": {remote:" enter the correct OA address "}}