JQuery Validate: remote - the username will not change in the error message

  • I am creating a registration form with Bassistance jQuery Validate, checking if the username is being used.
  • Everything works, if I fill in a username that is already in the database, a message like "xxxxxxx" is already used ..
  • However, if I fill out another username that is already in use (for example, yyyyy), the message continues to say: "xxxxxxx is already in use."
  • This behavior is also present in the "official" demo at http://jquery.bassistance.de/validate/demo/milk/ - if I first fill in "Peter" and then I fill in "George", the message says: "Peter already in use "
  • I was wondering if anyone found a fix for this?

My code is:

remote: jQuery.format("{0} is already in use.")

+4
source share
1 answer

Just looked through the jQuery Validate plugin code and they have a bug in the code where they cache error messages forever, which leads to what you see.

You are a small piece of code correct, they have an error at their end.

+2
source

Source: https://habr.com/ru/post/1383415/


All Articles