Forums

move data from one form to the next, or multipage form?

Minnie Mouse 11 Jul, 2016
sorry if this is answered somewhere else, I could not even think of a search term to look for...

here's what I want to do:
have a form with say 10 fields. A-J fields for example
I have a link to that full form.

on another page i want to place a teaser form with just fields A-C. when the user submits that form I want their info to go to the full page form and populate it and then they can answer the rest of the questions and submit the form to the site. as I am writing this, I realize it could be done as two separate parts of one form --one on the home page (teaser) and one on a finish page...... anyway I am not sure which way is the best to tackle this...

thanks for pointing me in the right direction!
L
Minnie Mouse 11 Jul, 2016
sorry i think i need to be more clear. the first part of the form would be placed on the home page in a module...
GreyHead 12 Jul, 2016
Hi Minnie Mouse,

I suggest that you use the Data to Session and Session to Data actions.

Add a Data to Session action in the On Submit event of the first form to save the data and give it an identifier string.

Add a Session to Data action in the on Load event of the second form using the same identifier string.

Bob
Minnie Mouse 12 Jul, 2016
Hi Bob, that worked a treat!! thank you!! i have one last question. i want to record in the database the submission off the home page... and then have it update on the second page. right now it gives me two data entries for one inquiry. is there a way to set up the second form to update instead of create new? (I want to capture the first form data so that i can tell if someone starts the process but doesnt finish it...)
GreyHead 12 Jul, 2016
Hi Minnie Mouse,

You need to save the new record id from the first save along with the rest of the form data. I think it should work if you put the Data to Session action after the DB Save action. That should make the record ID available to the DB Save on the second form which will then update the existing record.

Bob
Minnie Mouse 12 Jul, 2016
[attachment=0]Market_Hall_Catering_-_Administration.jpg[/attachment]
Minnie Mouse 12 Jul, 2016
sorry it didnt save my text i dont think. i did what you said with the id from the start. then i changed the model id info above and left the update options blank. i got the following error: Undefined index: dataupd in...
GreyHead 13 Jul, 2016
Hi Minnie Mouse,

You don't need to enable the Model ID (that is used to allow you to handle sub-sets of the form data). What you need to pass over is the record ID of the newly created record typically the id column name is either 'id' or 'cf_id'. If you temporarily add a Debugger to the first form On Submit event you will be able to see the new data item there.

Bob
This topic is locked and no more replies can be posted.