jQuery validation & ignore field

ethd picture ethd · May 11, 2012 · Viewed 22.2k times · Source

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

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

However it doesn't work, I always have an error (Please enter a valid date.).

I need help please !

Thanks,

Ed

Answer

Wellington Lorindo picture Wellington Lorindo · Feb 20, 2015

It works fine to me as described at the documentation http://jqueryvalidation.org/validate

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

And, for multiple field use:

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