jquery.validator.addmethod custom error message

How to implement a custom dynamic error message to your jQuery Validator method?

	var result;
        type: "POST",
        async: false,
        success: function(response) {
	 return result;

In the above code the message for the validator method is set by using


where the response.msg is the message we receive from the server.

This is a good and simple JavaScript snippet for the jQuery Validator plugin on how to add a jquery.validator.addmethod custom error message.

If you find this useful leave us a comment.

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.