Click to See Complete Forum and Search --> : Form Submission (Please Help!)


susha
03-14-2003, 12:46 AM
Hi,

I want to create a form that will send me the data through E-mail and then take the user to another HTML page. Can this be achieved with HTML and JavaScript?

Example:

<!------------ --------------->
<html>
<body>
<form action="MAILTO:susha@canada.com" method="post" enctype="text/plain">

<h3>This form sends an e-mail to an E-mail address specified.</h3>
Name:<br>
<input type="text" name="name"
value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail"
value="yourmail" size="20">
<br>
Comment:<br>
<input type="text" name="comment"
value="yourcomment" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">

</form>
</body>
</html>
<!------------ --------------->

The above code will send an E-mail to me. How can I take the user to another page after he clicks SUBMIT? For example, http://www.yahoo.com or a THANKS! page.

At least, I want to display a window showing acknowledgement.

Expecting your help,

Susha John.

gil davis
03-14-2003, 06:17 AM
<html>
<head>
<script>
function redirect() {
setTimeout("window.location='thanks.htm'",500);
}
</script>
</head>
<body>
<form action="MAILTO:nobody@nowhere.com" method="post" enctype="text/plain" onSubmit="redirect()">
<h3>This form sends an e-mail to an E-mail address specified.</h3>
Name:<br>
<input type="text" name="name" value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail" value="yourmail" size="20">
<br>
Comment:<br>
<input type="text" name="comment" value="yourcomment" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>

susha
03-14-2003, 06:56 AM
Hi Gil,

Thanks a lot for the code. It is working.

Have a nice day!

Susha.