Ajax Code

$.ajax({
data: $(“#contact-form”).serialize(),
url:”inc/sendmail.php”,
method:”POST”,
beforeSend: function() {
$(‘.message’).html(‘<div class=”message-success”><img src=”img/ajax-loader.gif” id=”loader” ></div>’);
}
})
.done(function(msg) {
if(msg==’1′){
$(‘.message’).html(‘<div class=”message-success”>Thank you for providing your Contact Information.<br/> One of our executive will contact you soon.!! </div>’);
$(“#loader”).hide();
$(“#contact-form input[type=text],textarea”).each(function(){
$(this).val(”);
});
}
else
$(‘.message’).html(‘<div class=”message-danger”> !Contact Information submission error. Please contact website administrator.</div>’);
});

Advertisements