Form not submitting with AJAX

后端 未结 6 1663
执笔经年
执笔经年 2021-01-17 00:29

=====UPDATE AGAIN==== (if anyone cares!) the solution I posted before stopped working for whatever reason. I included a beforeSend in my ajax request and pasted the portion

6条回答
  •  青春惊慌失措
    2021-01-17 01:27

    Update the code below:

    $('form').on('submit', function(e) {
    e.preventDefault();     
    if(!validateForm(this)){
    return true;
    }
    var formdata = $(this).serialize();
    
    $.ajax({
            type: "post",
            url: "http://www.example.com/client_config_send2.php",
            data: formdata,
            success:  function(data){
                alert("Thank you, we will get back to you shortly");
    }
            });
    
    })  
    
    
    
    

提交回复
热议问题