- $("#createAccount").validate({
- rules: {
- userName: {
- required: true,
- minlength: 2,
- remote: "users.php"
- }},
- messages: {
- userName: {
- required: "Enter a username",
- minlength: jQuery.format("Enter at least {0} characters"),
- remote: jQuery.format("{0} is already in use")
- }}
I have set up this validation rule and message from the examples that came in the JQuery.validation plugin. The first time the validation displays the correct message substituting the username into {0}. If I go into and leave the field a second time it shows the remote file name 'users.php' instead of the User name I entered.
The first time I click the submit button get 'wava66 is already in use'. If leave the field it is fine. But, the next time I enter and leave the field I get 'users.php is already in use'.
It only seems to happen after the second time I enter and leave the field. I always get the bogus message after the second time even if I enter a different duplicate user name.