Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

have two things happend after the submit button is pressed

Status
Not open for further replies.

junkmail

Programmer
Jan 7, 2001
134
US
Hi,

I would like to know if it is possible to have two different actions take place after the submit button is pressed? First I want the info to be sent to the server and then I want to go to another reference(meaning I want to have a different page appear). If I put two different Method="post" in my code the only one that happens is the one that is physically first in my code. I am new at this so can you be specific with your answer?

Thanks
Frank
 
<form name=&quot;myForm&quot; method=&quot;post&quot; action=&quot;page.htm&quot;>
...form stuff...
</form>

this submits the info to the server when the user clicks the submit button, then goes to the page specified in the action parameter.
 
You might want to try this.

<html>
<head>
<script language=&quot;javascript&quot;>
function goHere(){
self.location=&quot;page.html&quot;;
}
</script>
<body>
<form name=form method=&quot;post&quot; action=&quot;wheretosend&quot; onSubmit=&quot;goHere()&quot;>

</form>

The action will send the data to where you want it to go and the javascript will redirect them to you second page.

Roj


 
You could also have the program the data is sent to print out a location header. In perl it would look like this:
Code:
print &quot;Location: [URL unfurl="true"]http://www.somewhere.com/somepage.html\n\n&quot;;[/URL]
Make sure it's the only thing you print, and make sure there is a blank line printed after it. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top