JQuery Validate - Hide screen validation error messages / show user errors

I am using jQuery Validate, but I really do not want to have any error messages. Rather, I need to have red boxes around abusive inputs / outputs / etc. These red boxes were part of the cake to add, but I still cannot delete the error messages myself. How to disable them at all?

+46
jquery-validate
Oct. 16 '09 at 13:20
source share
3 answers

Use the special error posting function (see the options plugin), which adds nothing to the error message.

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

Or you can put the error messages in a different place on the page - say, in the DIV at the top of the page.

+125
Oct 16 '09 at 13:35
source share

You can override the showErrors function:

 jQuery('form').validate({ showErrors: function(errorMap, errorList) { // Do nothing here }, onfocusout: false, onkeyup: false, rules: { email: { required: true } }, messages: { email: { required: 'The email is required' } } }); 
+9
Oct. 16 '09 at 13:36
source share

This is how I do it. Just put $.validator.messages.required = ''; before calling to initialize validate () ie:

 $.validator.messages.required = ''; $('#formData').validate({});` 

This will display styles on the inputs, but no message labels!

+5
May 10 '15 at 12:41
source share



All Articles