submit form onload - auto submit - java - ASP - PayPal
The solution I found today was two simple steps:
1. <body onload='MyForm.MySubmitButtonName.focus()';>
I put step 1 anywhere near the top of the page and step 2 at the end of the form i.e.
<form name='MyForm' action='http://www.somewhere.com' method='post'>
<input type="hidden" name="Variable1" value="100">
<input type="hidden" name="Variable2" value="200">
Notes: 'MyForm' can be any name but be sure to replace it in all instances. The 'submit' button isn't really a 'submit' button, any input type will do.
I'm using this with ASP pages to submit to PayPal. I want to do some stuff like send an admin e-mail and post to a database before actually turning things over to PayPal without asking the user to click again. With this solution, the user clicks 'pay now' and I can do preliminary tasks and auto route them to PayPal.
|Posted by John at 10:32:53 AM in Web Development (13)|
My blank page with the form details on it stays within the browser when the PayPal page appears. How can I get the page to close after the submission is made?