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

Submit on Load 1

Status
Not open for further replies.

M444

Programmer
Feb 24, 2004
76
US
I need to be able to submit a form when a page loads without having the user click the submit button is this possible?

In other words I need to simulate the pushing of the submit button. I cannot just redirect unless it submits the form.

Thanks in Advance
 
Code:
<html>
<body [red]onload="document.forms['f'].submit();"[/red]>
<form name="f" action="page2.php" method="post">
<input type="hidden" value="5" name="step">
</form>
</body>
</html>

Why would you need this?

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Chessbot,

That works great! I can't thank you enough.

<Why would you need this?>
This has enabled me to automate a login procedure for a webpage ive been working on for a month now. Phew!

Thanks Again.
 
Glad you're finished... and thanks for the
star.gif
!

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
I was going to suggest a meta refresh with an address that has default values in a GET format... This would have the same effect, but it would use GET instead of submit. The upside, no JavaScript required.
 
jstreich said:
The upside, no JavaScript required.

There is also a downside with this method though as Meta Refresh can be disabled in the browser.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top