Okay so I think you should try this!
First run the php script as you would to send the email then after that include this line at the bottom of your php script
header("Location: http://myurl.com/contact?check=1");
Then on the contact page have an hidden input that contains the value 0 which is called check and then use url parameters to fill the input box.
On page load check the value of the hidden input box to see if its 1 or 0. If its 1 show a pop up box if its 0 load the page normally
I hope this helps!
USE THIS CODE
<form id="contactForm" method="post" action="contactengine.php">
<div class="row half">
<div class="6u">
<input type="text" class="text" placeholder="Name" name="Name" />
</div>
<div class="6u">
<input type="text" class="text" placeholder="Email" name="Email" />
</div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" placeholder="Message" name="Message"></textarea>
</div>
</div>
<div class="row" id="contactFormConfirmation" style="display: none;">
<div class="12u">
<p style="color: white; background-color: #FF3B30;width: 325px;border-radius: 0.25em;padding: .3em;margin: 0 auto;">Thank you for getting in touch!</p>
</div>
</div>
<div class="row">
<div class="12u">
<ul class="actions">
<li>
<input type="submit" name="submit" id="contactFormSubmit" class="form-button" value="Submit" />
</li>
<li>
<input type="reset" name="reset" id="submitFormReset" class="form-button alt" value="Clear" />
</li>
</ul>
</div>
</div>
</form>
<form name="checkf" id="checkf">
<input name="check" id="check" value="0">
</form>
EDIT:
Change the code you added just to the one below I forgot to add a line in lol
<script type="text/css">
function fcheckf(){
var x = document.getElementById('check').value;
if(x == 0)
{
return false;
}
else
{
alert("Thank you for submitting your data! - This is the pop up box content!");
}
}
</script>
Once you have added the above in, change your:
<body>
tag, to this:
<body onload="fcheckf()">
Another Edit
Now add this just before the
</body>
tag. This is important that it is pasted in the line before the body tag :)
<script type="text/javascript">
var data=location.search;
if(data) {
data=location.search.substring(1);
data=data.split('&');
var pairs={};
for(var i=0; i<data.length; i++){
var tmp=data[i].split('=');
pairs[tmp[0]]=tmp[1];
}
var f = document.checkf;
for (var i in pairs) {
if(f.elements[i]) {f.elements[i].value = pairs[i];}
}
}
EDIT 56981 V3
Use this code within your html
<script>
function fcheckf(){
var x = document.getElementById('check').value;
if(x == 0)
{
return false;
}
else
{
alert("Thank you for submitting your data! - This is the pop up box content!");
}
}
</script>
<section id="fourth" class="contact">
<header>
<div class="container">
<span class="image-header-contact"><img src="images/contact-header.png" alt="Video" /></span>
<h2>Get In Touch</h2>
</div>
</header>
<div class="content style4 featured">
<div class="container small">
<form id="contactForm" method="post" action="contactengine.php">
<div class="row half">
<div class="6u">
<input type="text" class="text" placeholder="Name" name="Name" />
</div>
<div class="6u">
<input type="text" class="text" placeholder="Email" name="Email" />
</div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" placeholder="Message" name="Message"></textarea>
</div>
</div>
<div class="row" id="contactFormConfirmation" style="display: none;">
<div class="12u">
<p style="color: white; background-color: #FF3B30;width: 325px;border-radius: 0.25em;padding: .3em;margin: 0 auto;">Thank you for getting in touch!</p>
</div>
</div>
<div class="row">
<div class="12u">
<ul class="actions">
<li>
<input type="submit" name="submit" id="contactFormSubmit" class="form-button" value="Submit" />
</li>
<li>
<input type="reset" name="reset" id="submitFormReset" class="form-button alt" value="Clear" />
</li>
</ul>
</div>
</div>
</form>
<form name="checkf" id="checkf">
<input name="check" id="check" value="1">
</form>
</div>
</div>
</section>
<script>
var data=location.search;
if(data) {
data=location.search.substring(1);
data=data.split('&');
var pairs={};
for(var i=0; i<data.length; i++){
var tmp=data[i].split('=');
pairs[tmp[0]]=tmp[1];
}
var f = document.checkf;
for (var i in pairs) {
if(f.elements[i]) {f.elements[i].value = pairs[i];}
}
}
</script>