jQuery Validation plugin: submitHandler not preventing default on submit when making ajax call to servlet - return false not working

前端 未结 5 1298
渐次进展
渐次进展 2021-01-14 06:35

I have a simple form that uses jquery and a servlet. The jquery makes an ajax call to the servlet, the servlet makes some server side calculations, then displays the result

5条回答
  •  我在风中等你
    2021-01-14 07:39

    You can have event as the second parameter of submitHandler and can do preventDefault there itself.

    submitHandler: function (form, event) {
        event.preventDefault();
        // your remaining code goes below this.
    }
    

提交回复
热议问题