submit form after validation jquery

前端 未结 5 1319
迷失自我
迷失自我 2021-02-08 02:43

I have following form:

  • Name
5条回答
  •  眼角桃花
    2021-02-08 03:35

    When you say that the "date inside form is submitted" that makes no sense to me because in your code snippets I see nothing called "date".

    I've used the .validate() plugin extensively... What I can tell you that may help is that the validate plugin you're using has a submitHandler function that you can use...

    // validate comment form
    $("#form").validate({
    submitHandler : function(form) {
        //do something here
        form.submit();
    }
    });
    

    The submitHandler is called only if all the rules for validation are met. Namely in your case you have three fields with "required" on them which means that this form will NOT be submitted unless all three fields have a value.

    With that, I can tell you for sure that with the information provided there is nothing to indicate the problem you're describing. Providing more and better information will help us figure out what's wrong.

提交回复
热议问题