Can JQuery.Validate plugin prevent submission of an Ajax form

后端 未结 7 1792
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 15:35

    $('#contactform').ajaxForm({
      success : FormSendResponse, 
      beforeSubmit:  function(){
        return $("#contactform").valid();
      }
    });
    
    
    $("#contactform").validate();   
    

    Above code worked fine for me.

提交回复
热议问题