Solved

Auto-Submiiting a Form Question

Posted on 2006-06-14
3
264 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

820 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