Preventing a form from submitting in jQuery Validate plugin's submitHandler function

后端 未结 8 1664
花落未央
花落未央 2020-12-08 07:24

I am using jQuery with the validate plugin at http://docs.jquery.com/Plugins/Validation/validate

I want to prevent the form from submitting after its validation and

8条回答
  •  我在风中等你
    2020-12-08 08:06

    $("#myform").validate({
       rules: {...},
       submitHandler: function(form, event) { 
          event.preventDefault();
          alert("Do some stuff...");
          //submit via ajax
       }
    });
    

    Hope this help.

提交回复
热议问题