JQuery validation and ignore field

I have a form with id myformand two fields (dates) with a class date. I would like to avoid jquery.validation (unobtrusive jquery validation on ASP.NET MVC3) for these two fields. I tried:

    $('#myform').validate({
        ignore: ".date"
    });

However, it does not work, I always have an error ( Please enter a valid date.).

I need help please!

Thank,

Ed

+5
source share
3 answers

You need ignoreTitle, according to this document .

0
source

This works great for me as described in the documentation at http://jqueryvalidation.org/validate

$("#myform").validate({
   ignore: ".ignore"
});

And for use in multiple fields:

$("#myform").validate({
   ignore: ".ignore, .another_class"
});
+4
source

, jquery.validate.unobtrusive, , , $("#myform").validate() :

$('#myform').validate().settings.ignore = ".date";
$('#myform').valid();

An unobtrusive plugin invokes validate()when loading a document that sets default options. Then a validator will be created and cached, and any further calls validate()will ignore the new parameters and return the cached validator.

0
source

All Articles