Jquery submits form code sharing asynchronously

  • 2020-05-19 04:05:43
  • OfStack

Function is very practical code is also very simple, no more nonsense, directly on:


$.ajax({
        url:"mobileSurveyAction_addSurvey.action",// Submit the address 
        data:$("#form1").serialize(),// Serialize the form data 
        type:"POST",
        dataType:"json",
        success:function(result){
          if (result.success == '100'){
            $("#mySection").hide();
            $(".footer").hide();
            $("#alertMsg").show();
             
          }else{
            alert(" Failure! ");
          }
        }
      });

That's all for this article, and I hope it will help you master the asynchronous submission form.

Please take a moment to share this article with your friends or leave a comment. We will sincerely appreciate your support!


Related articles: