jquery validate need to click submit twice to submit form

后端 未结 3 1554
南笙
南笙 2021-01-13 09:04

I have a form in a modal, the user has to complete the form (otherwise validation will display the required fields error messages), then click the submit input type, it does

3条回答
  •  日久生厌
    2021-01-13 09:26

    I had the same issue and resolved it by adding the following to my validate:

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

    onfocusout will remove the focus from your form fields and submit button will work on the first click.

    See more at https://jqueryvalidation.org/validate/

提交回复
热议问题