How to trigger validation without using a submit button

后端 未结 2 588
野的像风
野的像风 2021-01-01 19:38

I am using the jQuery Validation plugin and trying to trigger the validation/submit with an alternate button. I would like to create a jquery function that will change the c

相关标签:
2条回答
  • 2021-01-01 19:48

    You have to call validate with no arguments to trigger the validate function, like this:

    $("#applicant-form").validate();
    
    0 讨论(0)
  • 2021-01-01 19:49

    You should be able to just call valid on whatever element you like:

    $('selector').valid();
    

    Here are some references:

    http://docs.jquery.com/Plugins/Validation/valid

    http://docs.jquery.com/Plugins/Validation/validate

    0 讨论(0)
提交回复
热议问题