Function That Allows Page Self-Post and Then Redirect
Posted: Wed Apr 01, 2009 12:26 pm
Other than nice graphics, I have a very simple web page for food donations for our town. (There will also be one for fuel assistance.) A user enters a donation amount, clicks on Next, and is redirected to a payment processor's site. I even have sample code, but there's a catch.
Before Next's onClick causes the form's action to go to a new URL (of the payment processor), the form must first post to itself. It must post to itself, so that the donated amount is read, combined with more information required by the payment processor, like username and password, and is then encrypted.
If the user enters the amount and clicks on Next, the form does get a chance to self-post, and the hand-off to the payment processor fails. If I put a contrivance into the web page, like a Check Amount button, then asking the user to click on that causes the form to post to itself. Then, when the user presses Next, the hand-off to the payment processor works fine.
I would prefer not to have a contrivance. How can I get a form to post to itself (when Next is pressed) and then hand-off to a new URL?
Thanks.
cmn
Before Next's onClick causes the form's action to go to a new URL (of the payment processor), the form must first post to itself. It must post to itself, so that the donated amount is read, combined with more information required by the payment processor, like username and password, and is then encrypted.
If the user enters the amount and clicks on Next, the form does get a chance to self-post, and the hand-off to the payment processor fails. If I put a contrivance into the web page, like a Check Amount button, then asking the user to click on that causes the form to post to itself. Then, when the user presses Next, the hand-off to the payment processor works fine.
I would prefer not to have a contrivance. How can I get a form to post to itself (when Next is pressed) and then hand-off to a new URL?
Thanks.
cmn