Forum Moderators: open

Message Too Old, No Replies

html dual action button

html

         

Gr33ny

1:23 am on Aug 15, 2006 (gmt 0)

10+ Year Member



I need a form button to email form info and redirect to a different page...can someone tell me what I'm doing wrong?

-------------------------------------------------------
<form action="mailto:joeschmo@email.com" method="post" enctype="text/plain" name="form1" id="form1">
<input type="button" name="button" value="Next"

onclick="javascript:window.location.href('http://www.redirectedwebsite.com'); document.form1.submit();"

/>
</form>
-------------------------------------------------------

any help is appreciated
thx

garann

6:28 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



You're asking your page to go to two places at once. The best way to accomplish what you want would be with server side scripting. Then you can submit your form to one page that sends the email and then redirects to "redirectedwebsite.com". If that's not an option for you, I'm not sure what you can do beyond opening the redirected page in a new window before submitting the form.

One thing you could try is switching your two Javascript commands, so you submit first and then redirect. Seems unlikely, but maybe you can queue up the request to redirect before the browser submits? I know submitting an email is a little weird, so maybe you'd have some luck...