Can JQuery.Validate plugin prevent submission of an Ajax form

后端 未结 7 1802
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 15:00

I am using the JQuery form plugin (http://malsup.com/jquery/form/) to handle the ajax submission of a form. I also have JQuery.Validate (http://docs.jquery.com/Plugins/Validatio

7条回答
  •  猫巷女王i
    2021-02-02 15:24

    ... well it's been a while so my situation has changed a little. Currently I have a submitHandler option passed to the Validate() plugin. In that handler I manually use ajaxSubmit. More a workaround than an answer I guess. Hope that helps.

    http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html

    var v = jQuery("#form").validate({
        submitHandler: function(form) {
            jQuery(form).ajaxSubmit({target: "#result"});
        }
    });
    

提交回复
热议问题