submit form on click event using jquery

前端 未结 5 604
悲&欢浪女
悲&欢浪女 2021-01-01 21:28

So can someone please tell why neither of these options will actually submit the form? I am trying to do something more complicated but I have boiled it down to this to try

5条回答
  •  臣服心动
    2021-01-01 21:43

    Why not simply use the submit button to run the code you want. If your function returns false, it will cancel the submission.

    $("#testForm").submit(function() {
        /* Do Something */
        return false;
    });
    

提交回复
热议问题