jQuery: Stop submitting form, perform script, continue submitting form?

前端 未结 8 1050
遇见更好的自我
遇见更好的自我 2021-02-04 02:09

I have a form, and when I submit him I execute multiple script. Here is my code:

$(\"#RequestCreateForm\").submit(function (e) {
    if ($(\"#RequestCreateForm\"         


        
8条回答
  •  余生分开走
    2021-02-04 02:53

    $("#RequestCreateForm").submit(function (e) {
        if ($("#RequestCreateForm").validate().checkForm() == false) { return; }
    
        e.preventDefault();
    
        //many scripts
    
        // Bypass the jquery form object submit and use the more basic vanilla
        // javascript form object submit
    
        $("#RequestCreateForm")[0].submit();
    
    }
    

提交回复
热议问题