A
A
ArkadiSpir2018-03-19 20:51:01
JavaScript
ArkadiSpir, 2018-03-19 20:51:01

How to show contact form again after successful submission?

Hello!
The site has a form. After submitting, the form is hidden and instead a div appears with a message that the submission was successful. To send a message again, you need to reload the page.
Question. How can I make the div hide after a few seconds and the form reappear without reloading the page, even without resetting the typed text?
Thank you.
if(mail($address, $e_subject, $msg, $headers)) {
// Email has sent successfully, echo a success page.
echo "";
echo "";
echo "Message sent!";
echo "Thank you $name, your message has been sent to us!";
echo "";
echo "";
} else {
echo ' MISTAKE!';
}
slow',function(){$(this).remove()}); $('#submit').removeAttr('disabled');
ajax-loader.gif
if(data.match('success') != null) $('#contactform').slideUp('slow');
}
);
});
return false;
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question