JQueryValidation - input error class name

Is there a way with the jQueryValidation plugin to set the input error of the css class. This css class is different from the css label error class.

Because if I install: errorClass: "field-validation-error"

This will be used to enter shortcuts and . I would like the input to have the class "css-error-error-error-css" and a label to have the class css-validation-error.

+3
source share
1 answer

I see no real reason to support different class names for the error element and the input field itself.

Just use CSS selector

label.field-validation-error {
  ..whatever styling...
}
input.field-validation-error {
  ..whatever styling...
}

So both have the same css class but get different style


, , highlight unhighlight . . - ,

+4

Source: https://habr.com/ru/post/1737266/


All Articles