I\'m using the jQuery validation plugin in a very similar manner to the Remember The Milk demo.
$(\"#registrationForm\").validate({
rules: {
email: {
Over two years later and the bug still doesn't seem to be fixed, so here's what I found:
The issue is in the remote
function:
remote: function(value, element, param) {
if ( this.optional(element) )
return "dependency-mismatch";
var previous = this.previousValue(element);
if (!this.settings.messages[element.name] )
this.settings.messages[element.name] = {};
previous.originalMessage = this.settings.messages[element.name].remote;
this.settings.messages[element.name].remote = previous.message;
// snip more code...
}
Trouble is that on the 2nd and later evaluations of this function, the messages[element.name].remote
contains a specific (text) error message, and the actual original message is lost forever when previous.originalMessage
is overwritten after that.
I was able to work around the issue by adding a check before that line:
if (!previous.originalMessage)
previous.originalMessage = this.settings.messages[element.name].remote;
I'm not sure if this is really the correct solution, but it works - validation failures now reapply the format function on each validation failure.
The user name field on the Remember the Milk demo fails in the same way (when entering user names 'Peter' and 'George'), so you've probably found a bug in the plugin.