I have this email newsletter field that works. I just dont want the person to be directed away from the page they are on when they submit the form.
Is there a way to process the form then have a window pop-up saying:
Thank you for submitting $email!
My HTML
<form action="/includes/submitEmail.php" method="post">
Email: <input type="text" name="email" />
<input type="submit" value="Submit" />
</form>
My PHP
//Gather information
$email = $_POST['email'];
//Submit information
$query = ("INSERT INTO emails (id, email) VALUES ('NULL', '".$email."')");
mysql_query($query) or die (mysql_error());
echo "updated with: ".$email." successfully";
Is there a way I can have javascript Validate that its a real email address then process the form?