Solved

Auto-Submiiting a Form Question

Posted on 2006-06-14
3
262 Views
Last Modified: 2012-06-27
Hi All,
I have a page where I want it to auto-submit without the user seeing it. What is the easiest way to do this? The reason I need to do this is because the php curl function won't operate properly if I re-post the page to itself and then pass on to a Paypal page. I now have two pages set-up but as the second page is purely functional (no use to the user) I don't want them to have to click another submit button. Is there an easy php or javascript solution to this? Any help would be much appreciated.
Thanks,
D
0
Comment
Question by:dereksheahan
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 16901716
Hi dereksheahan,

<body onload="document.forms[0].submit();">

So when the page loads, the form is submitted automatically.

Tim Cottee
0
 
LVL 20

Expert Comment

by:Gawai
ID: 16902121
to work timcottee code, u should write <form> attributes as well.

<body onload="document.Autofrm.submit();">
<form action="finalpage.htm" method="post" name="Autofrm">
<input type......................>
.....

</form>
</body>



@-GaWai-@
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 16902173
gawai,

Indeed, though that was assumed (perhaps I shouldn't have).

Tim
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question