Contact form

gazza777
Offline
Last seen: 2 years 3 months ago
Tue, 12/02/2014 - 02:52
#1
Contact form

Hi,

I'm very disappointed with the contact form, it opens in anew blank page with a few lines of text on submit? Surely this isn't correct?

gazza777
Offline
Last seen: 2 years 3 months ago
Tue, 12/02/2014 - 03:03

Nevermind, I see I took this code out

$(function() {
"use strict";
$("#arrival-date, #departure-date").datepicker({
// showOn: "button",
// buttonImage: "images/calendar.gif",
// buttonImageOnly: true
});

// Script for Popup Map Address
// $('.popup-gmaps').magnificPopup({
// // disableOn: 700,
// type: 'iframe',
// mainClass: 'md-map',
// removalDelay: 160,
// preloader: false,
// fixedContentPos: false
// });

$('.popup-gmaps').magnificPopupMap();

if($("#contact-form").length > 0){
// Validate the contact form
$('#contact-form').validate({
// Add requirements to each of the fields
rules: {
name: {
required: true,
minlength: 2
},
email: {
required: true,
email: true
},
message: {
required: true,
minlength: 10
}
},

// Specify what error messages to display
// when the user does something horrid
messages: {
name: {
required: "Please enter your name.",
minlength: $.format("At least {0} characters required.")
},
email: {
required: "Please enter your email.",
email: "Please enter a valid email."
},
message: {
required: "Please enter a message.",
minlength: $.format("At least {0} characters required.")
}
},

// Use Ajax to send everything to processForm.php
submitHandler: function(form) {
$("#submit-contact").html("Sending...");
$(form).ajaxSubmit({
success: function(responseText, statusText, xhr, $form) {
$("#contact-content").slideUp(600, function() {
$("#contact-content").html(responseText).slideDown(600);
});
}
});
return false;
}
});
}
});

Log in or register to post comments