Created
January 21, 2011 10:47
-
-
Save mnowakowski/789525 to your computer and use it in GitHub Desktop.
Custom message in addMethod for jQuery validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$j.validator.addMethod("remote_data", function(value, element, params) { | |
var my_message = "some message"; | |
$j.ajax({ | |
... | |
}); | |
if (correct){ | |
return true; | |
} else { | |
$j.validator.messages.remote_data = my_message; | |
return false; | |
} | |
}, "" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, it was working for me