how to perform some action before submit form via .ajaxForm()?

后端 未结 3 838
刺人心
刺人心 2021-02-15 11:44

i am using ajaxForm() frame work to send my data without reloading my page.

    $(\'#ReplayForm\').ajaxForm({ 

      success : function(data){
             aler         


        
3条回答
  •  别跟我提以往
    2021-02-15 12:18

    Use beforeSend option in JQuery AJAX framework, if the test fails return false should do it.

    $('#ReplayForm').ajaxForm({ 
    
      success : function(data){
             alert("Success");
      },
      beforeSend: function() {
          if(!myFunc()) {
              return false;
          }
      }
    });
    

提交回复
热议问题