Auto submit button

admin

Administrator
Staff member
Heya again,<br />
<br />
This is a bit of an odd one, or at least it is to me. I'm looking for a way to make a button auto submit without the use having to click it. A bit like the autoforwarding pages.<br />
That's the short version of what I'm looking to do.<br />
<br />
More detail:<br />
I have some variables that I'm pulling through from one page to the next through a payment processor. They fill in their billing info etc, and click continue. <br />
<br />
When they land on the second page, they would have to create a username and password, and enter their e-mail address, then click the continue button. This info is then forwarded to an account manager script which records the info and creates their username and pass. All well and good, but I want to cut out that second page.<br />
<br />
So instead of filling in a whole second page with the user and pass, I'm taking details from the payment page, passing them on to the user and pass creation page, and entering them in the code as hidden variables. <br />
<br />
So the variables are all filled in fine, but I don't want the user to have to click the submit button to submit all the hidden information, hence why I need the button on that page to submit automatically. <br />
<br />
Hehe that's it. I hope it made sense. I'm hoping there's a way to do that html wise rather than having to fiddle with php (which I'm not so great at). Any ideas?<br />
<br />
Thanks for your time ;)<br />
Mopy<!--content-->nope especially if you gave the user time to read what is being submitted.<br />
<br />
you can however forward to another page but you can't submit the info unless you did it in the url, which is not safe.<!--content-->Righty, I think I have an alternative solution. Thanks anyway. :)<br />
<br />
Just in case you were wondering about me putting customers info at risk, the credit card details etc isn't accessable to me. It's done with PaySystems. The only info I'm using that isn't secure is first name, the second half of their e-mail address and the first part of their post code/zip code. ;)<br />
<br />
Take Care<br />
Mopy<!--content-->well, if you are confident the data being auto submitted is correct, you can do something like this:<br />
<br />
<br />
<html><br />
<head><br />
<title>your title</title><br />
<meta http-equiv="Pragma" content="no-cache"><br />
<meta http-equiv="no-cache"><br />
<meta http-equiv="Expires" content="-1"><br />
<meta http-equiv="Cache-Control" content="no-cache">\n);<br />
<SCRIPT LANGUAGE="JavaScript" type="text/javascript"><br />
function ReDirect() {<br />
self.document.forms.autofilled.submit()<br />
}<br />
</SCRIPT><br />
</head><br />
<body onload="setTimeout('ReDirect();', 1000)"><br />
<form name="autofilled" method="get" action="yourscript.php"><br />
<input type="hidden" name="name" value="John Doe"><br />
</form><br />
<h1>Thank you, just a moment please!</h1><br />
</body><br />
</html> <br />
<br />
<br />
if you have a script generating the page, just have it add all the hidden form fields you need and fill in the values. But make sure your script is validating the form that is being submitted like this to insure its getting what it expects and not getting what it does not expect.<br />
<br />
You can use method="post" in the form to hide the data from the user once the form is submitted (it will not show up in the address window of the next page), but if they click the refresh button after the next page loads the form data will be resubmitted, which might or might not be a problem, depends on your script.<!--content-->Perfect, thanks very much. That cuts out a whole page for the signup process. <br />
<br />
The info has to be correct, otherwise the payment won't be accepted. It's also made clear that the non payment essential details such as e-mail address need to be correct and entered twice, otherwise they won't receive their log in info.<br />
<br />
Thanks Kevin, made things much easier :)<br />
Take Care<br />
Mopy<br />
<br />
::edit:: Sorry, I forgot to mention, if someone refreshes the page and the info is re-submitted, that's no problem as all they'll see is an error page saying their details have already been taken. Due to the mix of non sensitive data I'm using from the payment form, theres a one in a million chance of dupication (if not more). Everything is covered :)<br />
Thanks again.<!--content-->
 
Back
Top