Changing the style of error messages for jQuery validation plugin

Is it possible to change colors, font, etc. jQuery validation form module error messages?

+4
source share
2 answers

Using this plugin, you can also specify which class you want to use for the error state.

$('.selector').validate({ errorClass: 'newError' }); 

There are also highlight and ambiguity options that allow you to apply a more complex style to an element containing an error, for example:

 $('.selector').validate({ highlight: function(element, errorClass) { $(element).fadeOut(function() { $(element).fadeIn(); }); } }); 

http://docs.jquery.com/Plugins/Validation/validate#options

+2
source

If you use the bassistance.de plugin, there is an associated class with every pop-up warning. So all you have to do is css the changes to these classes. label.warning or label.error will be a selector to be able to change the style for alerts. I was able to figure this out by firing the warnings that appear on one of the demos for this plugin.

+1
source

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


All Articles