Hey guys,
I have a bit of a problem with implementing an ajax based contact form. I am sure I forgot something...does this almost look right? What do you think the problem is, the form still submits but the page refreshes instead of just sliding the form up and fading in my success message. Any help would be greatly appreciated.
$(document).ready(function() {
//Define URL to PHP mail file
var url = "contact.php";
//Activate jQuery form validation
$("#contact").validate({
submitHandler: function() {
//Define data string
var datastring = $("#contact").serialize();
//Submit form
$.ajax({
type: "POST",
url: url,
data: datastring,
success: function(){
$('#contact').slideUp();
$('#process_message').fadeIn();
}
});
}
});
});