Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Validate - Hide display validation error messages / show custom errors

I'm using jQuery Validate, but I really don't want to have any error messages whatsoever. Rather, I need to have red boxes around offending inputs/selects/etc. These red boxes were a piece of cake to add, but I still cannot remove error messages themselves. How do I disable them altogether?

like image 492
Anton Gogolev Avatar asked Oct 16 '09 13:10

Anton Gogolev


1 Answers

Use a custom error placement function (see the plugin's options) that doesn't append the error message to anything.

$('#form').validate({   errorPlacement: function(error,element) {     return true;   } }); 

Or you could put the error messages elsewhere on the page - say in a DIV at the top of the page.

like image 126
tvanfosson Avatar answered Sep 27 '22 02:09

tvanfosson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!