I'd like to customize the errorPlacement
only for certain fields, and defer to the plugin's default placement for the rest. Something like:
errorPlacement : function(error, element) {
if($(element).prop("id") === "mySpecialField") {
$("#mySpecialErrorMessageHolder").append(error);
}
else {
// this is not valid syntax but it's what I really want...
super.errorPlacement(error, element);
}
}
Is this possible?
errorPlacement : function(error, element) {
if($(element).prop("id") === "mySpecialField") {
$("#mySpecialErrorMessageHolder").append(error);
}
else {
error.insertAfter(element); // default error placement.
}
}
Looking at the source, the default behavior is to use insertAfter
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With