After successful form validation, I want to display a popup successful message using fancybox plugin.
Here is my php code -
<?php
if(isset($_POST['cfsubmit'])){
//if no erros, echo the results
if(!$errorExists){
echo "<div id='c_confirm'><p><span class='check_mark'></span>Thank you for contacting With us. One of our customer service representatives will get back to you within 24 hours.</p></div>";
$emailTo = "[email protected]";
if (!isset($emailTo) || ($emailTo == '') ){
$emailTo = get_option('admin_email');
}
$subject = 'Contact Form from '.$fname;
$body = "First Name: $fname \n\nLast Name: $lname \n\nCheck In date: $check_in_date \n\nCheck Out date: $check_out_date \n\nApartment type: $apart_type \n\nPhone: $phone \n\nEmail: $email \n\nComments: $comments";
$headers = 'From: '.$fname.' <'.$email.'>' . "\r\n" . 'Reply-To: ' . $email . "\r\n";
wp_mail($emailTo, $subject, $body, $headers);
}else{
echo "<h3>Error!</h3>".$errors;
}
}?>
I want to display this message , in a popup box. Using jquery fancybox plugin.
<div id='c_confirm'><p><span class='check_mark'></span>Thank you for contacting With us. One of our customer service representatives will get back to you within 24 hours.</p></div>