automated form submissions
Moderator: General Moderators
automated form submissions
Was wondering, is it possible to have a form autosubmit? for example:
if i gather information on form A and send the information to a new page where I make a needed calculation for instance qty*price, then have a second form including my calculations submit automatically? Basically so that the user never sees the second form, it just appears to go through to proper page.
Thanks!
if i gather information on form A and send the information to a new page where I make a needed calculation for instance qty*price, then have a second form including my calculations submit automatically? Basically so that the user never sees the second form, it just appears to go through to proper page.
Thanks!
Code: Select all
document.formName.submit();- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Sometimes it is not possible to skip the second form. I recently made a script who saves a user input then redirects him to paypal web payments standard form with auto submit.
It is not possible to skip the auto submit because it needs to process the entry, save the data and decide if he should be transfered to paypal or not. And this should be made without second user confirmation.
I don't see any other ways but auto submit.
It is not possible to skip the auto submit because it needs to process the entry, save the data and decide if he should be transfered to paypal or not. And this should be made without second user confirmation.
I don't see any other ways but auto submit.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Then use the suggestion above. You can call it at any point. I'd do so directly after the form was created.
I personally don't like using the document.formName format, but it's the easiest to understand.
Code: Select all
<form name="toPayPal" method="post">
...
</form>
<script type="text/javascript">
document.toPayPal.submit();
</script>- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm