Skip to content

Instantly share code, notes, and snippets.

@mnowakowski
Created January 21, 2011 10:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnowakowski/789525 to your computer and use it in GitHub Desktop.
Save mnowakowski/789525 to your computer and use it in GitHub Desktop.
Custom message in addMethod for jQuery validation
$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;
}
}, ""
);
@jigar2284
Copy link

Thanks, it was working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment