jquery validate plugin override error message for required: -
so have been trying global override of fields class 'required'. got can add red background field fails validation class required so:
$("#signup_form").validate({ errorclass: "validateerror" });
i have tried using errorplacement: function others have mentioned remove error param so:
$("#signup_form").validate({ errorclass: "validateerror" errorplacement: function (error, elemenet) { error.remove(); }, });
this kills validation entirely.
one forum mentioned need specify each field validation expect , override default 'required' message nothing in messages: function. how can set globally seeing setup needs dynamic anticipate field class required set it?
thanks lot
to style elements have validation errors, target default class errors css. default class error
.
.error { background-color: #ff0000; }
or perhaps more specifically:
input.error { background-color: #ff0000; }
to globally change validation error messages plugin, use this:
jquery.extend(jquery.validator.messages, { required: "your message here" });
reference: https://stackoverflow.com/a/2457053/594235
to remove error messages entirely, place return false;
inside errorplacement
callback function:
errorplacement: function () { return false; }
Comments
Post a Comment