Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('body').on('submit','#contact-form', function(event){
- event.preventDefault();
- var form = $(this);
- $.ajax({
- 'method': 'post', // use post since you use $_POST in php file to process data
- 'action': '/' + $(form).attr('action'), // url to send a form data
- 'data': $(form).serialize(), // serialized form data
- }).done(function(response){
- // to do something with response text
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement