How to remove jquery.validate from my form

I am using the jquery.validate plugin to validate the form that appears in the popup.

So how to remove validation for this form. i tried this

$("#close_button").click(function(){ var settings = $('form#user_form').validate().settings; // Modify validation settings $.extend(settings, { rules: {} }); tb_remove(); }); 

I need to remove the validation of my form. Help me. Thanks in advance...

Updated code ...

 $("#close_button").click(function(){ $("form#user_form").validate().cancelSubmit = true; }); 

I also tried

 <input type="button" class="cancel" name="close_button" id="close_button" value="Cancel"> 

I just added class cancellation to remove the confirmation of the group form.

My method does not work. Help solve this problem.

+4
source share
3 answers

There are several solutions to this question: jQuery Validation plugin: disable validation for the specified submit buttons

 $("form").validate().cancelSubmit = true; 

Sounds like you need to.

EDIT: You can customize the CSS class to disable validation when you attach validate() to your form, for example:

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

An example from this question: jQuery Validation plugin: disable validation for specified submit buttons when sending a handler

+2
source

use as:

  <input class="cancel" type="submit" value="Save" /> 
+1
source

You can add a cancel css class to the submit button to suppress validation

eg

 <input class="cancel" type="submit" value="Save" /> 

See the jQuery Validator documentation for this feature here: Skip validation on submit

EDIT:

The above method is deprecated and replaced by the formnovalidate attribute.

 <input formnovalidate="formnovalidate" type="submit" value="Save" /> 
0
source

All Articles