I’m using jQuery validation plugin.
I know how to wrap errors in a div, but I want to use different error classes for different forms(because of positioning).
Here is JavaScript how I wrap errors in a div:
errorElement: "div",
wrapper: "div", // a wrapper around the error message
errorPlacement: function(error, element) {
element.before(error);
offset = element.offset();
error.css('right', offset.right);
}
and my css:
div.error{
...some css styling
}
How I can set error div name ?
If I’m understanding correctly you want to use ‘ErrorClass’ to give the error a class to identify and style it.
Eg: