Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
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

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"
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900