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

后端 未结 3 829
刺人心
刺人心 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:21

    You can use the beforeSubmit option

    $('#ReplayForm').ajaxForm({
        beforeSubmit: function (arr, $form, options) {
            //check your conditions and return false to prevent the form submission
            if (!valid) {
                return false;
            }
        },
        success: function (data) {
            alert("Success");
        }
    });
    

提交回复
热议问题