I had a contact form that submitted to a php page with this content:
<?php
$to = 'emailtosendto';
$subject = 'New message from contact form';
$name = $_POST['fullname'];
$mail = $_POST['email'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$comment = $_POST['comment'];
$message = $_POST['message'];
$body = 'Mr/Mrs '.$name.' wishes to contact us.
He\'s from a company called '.$company.'.
You can email him back at '.$mail.', or call him on '.$phone.'.
He was sneaky and found us through '.$comment.'.
He would like to say,
'.$message.'';
ini_set('sendmail_from', '$mail');
mail($to, $subject, $body);
header('location:./?sent');
?>
I have now changed the form to a nice live validated jQuery form, you can see the fiddle of it below.
http://jsfiddle.net/swift29/6UC7m/
I was wodering how I could change any of this code to still do the same function but make it so a popup appears confirming the message has been sent using jQuery then for it to fade back out and the form have been reset
Thanks in advance, Swift
Instead of submitting, you can use AJAX. That way you can get a popup when its done.
Example: