Send email from webpage without postback/refresh
- by jb
Hi all. Long time reader, first time writer.
Quick query i hope someone can help me with.
I have a webpage (php, javascript) which has a small contact form for a user to fill in and email us. Not a problem in itself, i have a working form already.
Nothing noteworthy, just a form posting to a php page which sends an email.
<form id="myform" name="myform" method="post" action="Mailer.php">
So user fills in form, hits submit and the page changes to mailer.php and they find their way back to where they were.
What I want instead is for the to stay on the same page when submit is pushed.
The form div to update itself to just say 'message sent' or something.
I just want to avoid a full page refresh.
Much like how on say facebook, commenting on a status only updates that div.
Hope that is phrased clearly enough.
Cheers all,