Click here to Skip to main content
13,408,595 members (43,697 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hey guys I have a little problem.
I need 2 actions in 1 form.
the one action is on my own side (I want to insert sth. in a database) and the other action takes you to a payment system.
Somebody knows how to do this?
Posted 20-Jan-13 4:30am
OriginalGriff 20-Jan-13 9:51am
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Typical recommended approach would be:

1. Form is submitted to your page with custom logic. ( insert necessary data into db etc)
2. Page validates data, if validation fails - displays form again with validation errors
3. If data are OK - saves necessary data into db and issues 301 redirect to some "navigate to payment engine" page
Redirect is recommended to avoid form resubmitting if user presses reload page.
4. "Navigate to payment engine" page might include form markup with fields expected by payment engine + JavaScript code to submit form once page is loaded. It is good idea to show submit button on this form as well. Text could be "press here if you are not navigated to payment engine in 5 seconds"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180221.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100