JAVASCRIPT 13
Ajax submit By Guest on 30th March 2017 02:59:40 AM
  1. $(function () {
  2. $("#demo-modal-3").submit(function (e) {
  3.     e.preventDefault();
  4.     var form_data = $(this).serialize();
  5.     console.log(form_data);
  6. $.ajax({
  7.         url: "sendemail.php",
  8.         type: "POST",
  9.         dataType: "json",
  10.         data:form_data,
  11.         success: function(){
  12.         $("#modal-title3").hide();
  13.         $('#back_btn').hide();
  14.         $('#submit_btn').hide();
  15.         $('#last_form_step').html("<div id='message'></div>");
  16.         $('#message').
  17.         html("<center><h2><img id='checkmark' src='images/check_ok.jpg' />Your request has been submitted successfully!</h2></center>").
  18.         append("<center><h3>We will contact you in less than 24 hours to confirm your booking.</h3></center>").
  19.         append("<center><h3>Thank you for contacting us.</h3></center>").hide().fadeIn(1500); },
  20.         error: function(data, errorThrown){
  21.         console.log(errorThrown);
  22.        }
  23.     });
  24. });
  25.  
  26. });

Paste is for source code and general debugging text.

Login or Register to delete or keep track of your pastes.