Customize the default message for a rule [duplicate]
Is there a way to customize the default message for an invalid rule in jQuery Validate plugin?
I mean something like
whenever a field is required, and I have not specified a custom message, the message should be "custom message"
I have tried this code but without success
$.validator.setDefaults({
messages: {
required: "custom message"
}
});
jQuery.extend(jQuery.validator.messages, {
required: "custom message",
});
精彩评论