I’d like some advice on passing data from form to form. I need to do the following:
- collect registration data from class participants
- upon submit, authenticate and save data to the session array
- open the payment gateway form pre-populated with data already collected
- Upon payment confirmation, write session data to DB
It’s working through step 3 (primarily in php) but it requires the user to hit a submit button in between steps 2 and 3 which I’d like to avoid.
What’s the best way to post the info to the next form so that payment gateway site page opens pre-filled once step 2 is complete?
Also, my understanding that the session data will persist as long as the window is open so my plan is to have all of this happen in the same window. Please let me know if this is flawed thinking or if there’s a better way to accomplish this.
Thank you for your kind attention.
EDIT:
right now if the data is authenticated I have a function which will build the next form so: if (!$error) {createNextForm();}
I followed that up with document.forms[“paymentForm”].submit() but I think it lacks a triggering event and will just sit waiting, correct?
With javascript you can make a form to automaticly fire the submit action.
If you have jquery, and your form is like
just do
Without jquery:
immediately before tag put
Of course form fields have to be filled like: