How do I remove jQuery validation from a form?

后端 未结 10 1529
逝去的感伤
逝去的感伤 2020-12-02 20:10

I\'m using the jQuery validation plugin to validate a form, and I\'d like to remove the validation and submit the form if a certain link is clicked.

I am submitting

相关标签:
10条回答
  • 2020-12-02 20:39

    You can also use the public "rules" function in this way:

    $('input, select, textarea').each(function() {
        $(this).rules('remove');
    });
    

    That's what I'm using ;)

    0 讨论(0)
  • 2020-12-02 20:44
    $("#formName").validate().settings.ignore = "*";
    

    Refer : https://github.com/jzaefferer/jquery-validation/issues/725

    0 讨论(0)
  • 2020-12-02 20:49

    For all the tags input of form:

    $('#myform').validate().settings.ignore = '.valid';
    $('input').addClass('valid');
    

    It works for me.

    0 讨论(0)
  • 2020-12-02 20:51

    Trigger the DOM submit method to skip the validation:

    $("#listing")[0].submit();
    
    0 讨论(0)
提交回复
热议问题