Sinambela

Untitled

Apr 3rd, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. contactForm = function(){
  2. $("#contact-submit").on('click',function() {
  3. $contact_form = $('#contact-form');
  4.  
  5. var fields = $contact_form.serialize();
  6.  
  7. $.ajax({
  8. type: "POST",
  9. url: "_include/php/contact.php",
  10. data: fields,
  11. dataType: 'json',
  12. success: function(response) {
  13.  
  14. if(response.status){
  15. $('#contact-form input').val('');
  16. $('#contact-form textarea').val('');
  17. }
  18.  
  19. $('#response').empty().html(response.html);
  20. }
  21. });
  22. return false;
  23. });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment