hi there i'm currently trying to create a form for a site and this has been done succesfully however on sending the form it goes to a new page saying either "Thanks! Our Team will get in touch in next 24 hours" or "Oops! something went wrong, please try to submit later."
what i want it to do instead is give the same messages but in a pop up box (dimensions 300px (w) x 200px (h)) that allows the user to then click ok and stay on the same page.
this is the HTML form coding;
<form id="contact_form" method="post" action="contact.php" >
<div class="span6">
<label>First Name</label>
<input type="text" class="span6" id="name" name="first_name">
</div>
<div class="span6">
<label>Surname</label>
<input type="text" class="span6" id="name" name="last_name">
</div>
<div class="span6">
<label>telephone</label>
<input type="text" class="span6" id="telephone" name="telephone">
</div>
<div class="span6">
<label>Email</label>
<input type="text" class="span6" id="email" name="email">
</div>
<div class="span12">
<label>Message</label>
<textarea class="span12" id="comment" name="comment"></textarea>
</div>
<div class="span12">
<button type="submit" class="btn send-btn">Send <i class="icon-ok-sign"></i></button>
</div>
</form>
and this is the PHP echo coding
if(!empty($from_first_name) && !empty($from_last_name) && !empty($from_email) && !empty($message) && !empty($telephone))
{
mail(DEST_EMAIL, SUBJECT_EMAIL, $message, $headers);
echo SUCCESS_MESSAGE;
}
else
{
echo ERROR_MESSAGE;
}
I apologise if this is something obvious i am an extreme beginner with the PHP coding however and despite looking at this all day would really appreciate any help any one can offer.
Thankyou