Forums

Simple setup multi page form in v4

ReneC 03 Jun, 2011
Hi,

Is there anyone who can give me a step by step tutorial on how to set up a multi page form, which saves the data in the same db record.

I have no problem to create separate forms that link to each other, but the data of each form is saved in a new record.

My gratitude is enormous!

Rene
GreyHead 03 Jun, 2011
Hi Rene,

If you check my posts I posted a quick outline to this process in the last couple of days.

Bob
ReneC 03 Jun, 2011
Hi Bob,
Thank you for your reply!
I have seen your post and have been playing around with it before I posted my question.

I have done the following till now:
form1:
1. added the 'Data To Session' action on the On Submit event
2. Used the 'Show form' action to load the next form on the On Submit event

form 2:
1. Added the 'Session To Data' action on the On Load event
2. Added the 'DB Save' action on the On Submit event

The insert query then only inserts the variables on form 2, not the one from form 1, although I do see them in the session variable.

I did get this to work by adding a hidden field to the form and filled it with the variable. This works when I have a limited number of variables and a small amount of pages, but in the end my form needs to have 5 pages with at least 5 to 10 questions per page.

Is there an easier way to make sure to let the insert query see the other form variables in the session and insert them to in the DB?

I hope I explained my problem clear enough🙂

Thank you!
René
GreyHead 03 Jun, 2011
Hi René,

I don't have time to test right now but I think that a Custom Code block with a little PHP loop to put the stored session data into $form->data['input_name'] would do it.

It might mean amending the session stores to save the input names with the values in a $data array (or object) as I'm not sure that you can use $session->get() without the name.

Bob
ReneC 03 Jun, 2011
Hi Bob,

Thank you for your suggestion. I will try it out and post it here if I have a solution!

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