free hit counter

Submit Form Using Ajax In Php

ajax-form

A very simple tutorial submitting HTML form values without refreshing page using jQuery and Ajax. Just implement this and enrich your web applications.

you can also upload file using this method

use this j query

<script src=”http://malsup.github.io/jquery.form.js” type=”text/javascript”></script>

 

 

  1. $(document).ready(function(){  
  2.   
  3.     $(‘#submit_this’).live(‘click’function()            
  4.              {  
  5.                $(“#form_id_here”).ajaxForm({   
  6.                     
  7.                    target: ‘#app_data’// for response message   
  8.                    beforeSubmit:function(){  
  9.                         
  10.                        $(‘#button_div’).empty();  
  11.                        $(‘#button_div’).append(‘<input type=”button” value=”Processing…..” id=”np”>’);  
  12.            $(“#app_data”).html();  
  13.                        },  
  14.                    success: function(response) {  
  15.                        $(‘#button_div’).empty();  
  16.                        $(‘#button_div’).append(‘<input type=”button” value=”Submit” id=”submit_this”>’);  
  17.                          
  18.                       }  
  19.                   }).submit();  
  20.                  
  21.                });  
  22.   
  23.   
  24. });  

Leave a Reply