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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onload settimer

Status
Not open for further replies.

marianmarian

Programmer
Jan 17, 2003
40
CA
hi all,

i am doing a transaction processsing; my code is in php, javascript, and of course html;

once my customers click to place an order i sent them to a page called process.html telling them their transaction is being processed; this is just a an html page with lots of hidden form elements; and this process.html has a
<body onload=setTimeout("location.href='submit.php'",'5000');> which should redirect to submit.php after certain time, and save users transaction by using all the hidden form elements.

the problem i am having is since there is no submit button in process.html i am finding it hard to submit the hidden form values, is there a way that i can do this so that my page redirect can send the form values at the same time.

thanks for all your responses
 
<body onload=setTimeout("submit()",'5000');>
<form action='submit.php'>
<hidden variables here>
</form>
</body>

-kaht

banghead.gif
 
Although you might want to specify the form to submit, and you might want to get rid of the quotes around the 5000.

Code:
<body onload=setTimeout("document.forms['f'].submit()", 5000);>
<form name="f" action='submit.php'>
<hidden variables here>
</form>
</body>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
thanks for all your responses, but i am getting error that "document doesn't support this property or method", i am using IE 6.0.

<body onload=setTimeout("document.forms['form_values'].submit()",5000);>
 
Ahh,

This worked for me (with the form named "f"):

Code:
<body onload="setTimeout('document.f.submit()', 5000);">

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top