$(function () {
$("#contactForm input, #contactForm textarea").jqBootstrapValidation({
preventSubmit: true,
submitError: function ($form, event, errors) {
},
submitSuccess: function ($form, event) {
event.preventDefault();
var name = $("input#name").val();
var email = $("input#email").val();
var subject = $("input#subject").val();
var message = $("textarea#message").val();
$this = $("#sendMessageButton");
$this.prop("disabled", true);
$.ajax({
url: "contact.php",
type: "POST",
data: {
name: name,
email: email,
subject: subject,
message: message
},
cache: false,
success: function () {
$('#success').html("
");
$('#success > .alert-success').html("");
$('#success > .alert-success')
.append("Your message has been sent. ");
$('#success > .alert-success')
.append('
');
$('#contactForm').trigger("reset");
},
error: function () {
$('#success').html("
");
$('#success > .alert-danger').html("");
$('#success > .alert-danger').append($("").text("Sorry " + name + ", it seems that our mail server is not responding. Please try again later!"));
$('#success > .alert-danger').append('