AutoSubmit Form

admin

Administrator
Staff member
Hi I have this code to connect to a secure server to make a payment:<br />
<br />
How can I make it submit automatically once the page has loaded. <br />
echo"<form action=\"https://select.worldpay.com/wcc/purchase\" method=POST> <br />
<input type=hidden name=\"instId\" value=\"$acc\"> <br />
<input type=hidden name=\"cartId\" value=\"$cart_order_id\"> <br />
<input type=hidden name=\"amount\" value=\"$payable\"> <br />
<input type=hidden name=\"currency\" value=\"$site_currency\"> <br />
<input type=hidden name=\"desc\" value=\"Shopping Cart Order\"> <br />
<input type=hidden name=\"email\" value=\"$valid_user\"><br />
<input type=hidden name=\"name\" value=\"$name\"><br />
<input type=hidden name=\"address\" value=\"$address\"><br />
<input type=hidden name=\"postcode\" value=\"$postcode\"><br />
<input type=hidden name=\"country\" value=\"$country\"><br />
<input type=hidden name=\"tel\" value=\"$phone\"><br />
if($test=="Y"){<br />
<input type=hidden name=\"testMode\" value=\"100\"><br />
}<br />
<input type=submit value=\"Go!\"> <br />
</form>";<br />
<br />
Thanks<!--content-->As first, add the attribute name="SecureForm" to the <form> tag. Then, add onLoad="document.SecureForm.submit();" to the document's body tag. That should do.<!--content-->Thanks!!<!--content-->
 
Back
Top