jzaefferer/jquery-validation — Issue #312: Remote incorrectly relies on previous value even after resetForm()
Author: dashfwd
Created: 2012-02-06 20:04:14+00:00
State: open

I have a form that does server-side (remote) validation on a "name" field, to make sure it isn't a duplicate.

I fill out the form on the page with the name of "Fred", the server-side validation runs, and no errors occur, so I insert a row into the database for Fred.

Now the user clicks the "Add" button again (on the same page), and the user types in the exact same name ("Fred"). Here, server-side validation will never run because of this line in the "remote" method of the plugin:

if ( previous.old === value ) {
return previous.valid;
}

In other words, it will completely skip the validation check if it has been valid at some point in the past. Not that calling resetForm() doesn't help.

Note - this does NOT seem to be the same issue as #201, "A bug when field value change using validate remote".