When I submit the form it redirects me back to the same page using this code
PHP
if( empty($errors))
{
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('Location: index.html');
}
What I want it to do is stay on the same page without refreshing and then hide the div..
HTML
<div class="footer">
<div id="containerfooter">
<form method="POST" name="contactform" action="contact-form-handler.php" class="NewsLetter" class="NL__field NL__email">
<p>
<label for='name'>Your Name:</label> <br>
<input type="text" name="name" class="NL__field NL__email">
</p>
<p>
<label for='email'>Email Address:</label> <br>
<input type="text" name="email"> <br>
</p>
<p>
<label for='message'>Message:</label> <br>
<input type="text" name="message">
</p>
<input type="submit" value="Submit"><br>
</form>
</div>
</div>
JQuery
$('form').submit(function(){
$('#containerfooter').hide();
});