Post + new Webpage

How can I have a forms submit button mail the data to the appropriate person and then jump to a new webpage?
BoBAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sybeConnect With a Mentor Commented:
<form name="mailform" action="mailto:who@where.com" ENCTYPE="text/plain">

</form>

<form action="newpage.htm">

<input type="submit" onClick="SendMail()">

</form>


<script>
function SendMail() {
  document.mailform.submit();
  return true;
}
</script>
0
 
JagarCommented:
You could probably do it using MSMQ (Microsoft Messaging Queue), but I've never used this, so can't provide examples, buts its a pplace for you to start if no one can provide examples
0
 
bernfarrCommented:
You can probably do it by having an onsubmit javascript function. Be aware that some browsers specifically check for a form that sends mail and warns the user, so it may cause some angst for your users.
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
MasseyMCommented:
What you would need to do is create a CGI program that would take the input the user sent and then send a "redirection" header back.. This would redirect the page to another location..
0
 
sybeCommented:
Create 2 forms, one that is mailed, and one that is posted. You can make one of the forms completely hidden.

Then comparable to bernfarr's suggestion, make a submit button that calls a Javascript which will submit the 2 forms.

It will only work in javascript enabled browsers, but that's the majority of browsers.



0
 
BoBAuthor Commented:
Can I have an example javascript to do this?  I don't have cgi available to me on my server.
0
 
BoBAuthor Commented:
I'm looking for a little more than just "use a cgi program."  Could you please give me an example preferably in javascript.

BoB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.