Form Submission (Please Help!)

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?<br />
<br />
Example:<br />
<br />
<!------------ ---------------><br />
<html><br />
<body><br />
<form action="MAILTO:[email protected]" method="post" enctype="text/plain"><br />
<br />
<h3>This form sends an e-mail to an E-mail address specified.</h3><br />
Name:<br><br />
<input type="text" name="name"<br />
value="yourname" size="20"><br />
<br><br />
Mail:<br><br />
<input type="text" name="mail"<br />
value="yourmail" size="20"><br />
<br><br />
Comment:<br><br />
<input type="text" name="comment"<br />
value="yourcomment" size="40"><br />
<br><br><br />
<input type="submit" value="Send"><br />
<input type="reset" value="Reset"><br />
<br />
</form><br />
</body><br />
</html><br />
<!------------ ---------------><br />
<br />
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, <!-- m --><a class="postlink" href="http://www.EnglishBest.com">http://www.EnglishBest.com</a><!-- m --> or a THANKS! page.<br />
<br />
Expecting your help,<br />
<br />
Susha John.<!--content-->I don't think you can do this using the logic you mentioned,since once submit is triggered the rest of the page will be out of scope,<br />
You will need to serverside scripting or may be some other logic.<br />
<br />
Cheers<br />
<br />
Khalid<!--content-->Thanks a lot, Khalid.<br />
<br />
I don't want to use server side scripting. Any other way to achieve this?<!--content-->This seems to work...<br />
<br />
<html> <br />
<head><br />
<br />
<script language="javascript" type="text/javascript"><br />
<br />
function forwardpage()<br />
{<br />
window.location.href = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"http://www.yahoo.com";<br />
}<br />
<br />
</script><br />
<br />
</head><br />
<body> <br />
<form action="mailto:[email protected]" method="post" enctype="text/plain" onsubmit="forwardpage()"> <br />
<br />
<h3>This form sends an e-mail to an E-mail address specified.</h3> <br />
Name:<br> <br />
<input type="text" name="name" <br />
value="yourname" size="20"> <br />
<br> <br />
Mail:<br> <br />
<input type="text" name="mail" <br />
value="yourmail" size="20"> <br />
<br> <br />
Comment:<br> <br />
<input type="text" name="comment" <br />
value="yourcomment" size="40"> <br />
<br><br> <br />
<input type="submit" value="Send"> <br />
<input type="reset" value="Reset"> <br />
<br />
</form> <br />
</body> <br />
</html><!--content-->Interesting pyro,Actually it does seem to work,<br />
Logically it seesm wrong though,<br />
<br />
This why,<br />
<br />
once window.location.href is triggered the previous page should have been out of scope,hence reaching at the point to triggere action would not be possible,But it works so <br />
<br />
Why am I complaining..<br />
<br />
:D <br />
<br />
Awsome work around.<br />
<br />
Khalid<!--content-->I agree. I expected to have to set a Timeout or something. I decided to try it that way first and it worked... hmm... ;)<br />
<br />
Cheers!<!--content-->try it with NS6+<br />
<br />
:p <br />
<br />
Khalid<!--content-->I don't have any email set up with Netscape 7. It does, however pop up Netscape Composer, so it seems like it would work. Doesn't it?<!--content-->No,It does not look like ti works for ns<br />
<br />
I have just setup an email account for this testing,I get the mail but no redirection/forwarding<br />
<br />
Khalid<!--content-->I tried in Mozilla 1.2 and what it does in that is pops up the email in my Outlook, I then would have to manually hit send, and there is no re-direct. So, it was probably an IE bug... :p<br />
<br />
Anyway, like Khalid originally mentioned, server side coding is going to be your best bet for cross-browser compatibility - and you won't get any warning messages...<!--content-->
 
Back
Top