Jquery form submission to post to php - Javascript jQuery

Javascript examples for jQuery:Form Submit

Description

Jquery form submission to post to php

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
  <script>
       $('document').ready(function(){
           $('#submit1').on('click',function(){
           $.post('cart.php',{email:'email',pkgname:'pkgname'}).then(function(){
               $('form').submit();
           });//from www  .j  av  a 2  s .  c  o m
    });
       });
         
      </script> 
 </head> 
 <body> 
  <form action="cart.php" method="post"> 
   <input type="button" id="submit1" value="submit"> 
  </form>  
 </body>
</html>

Related Tutorials