Forums

Multi Page form with Back button not saving data in session

Dtorr1981 04 Jul, 2018
Hi Guys,

I'm still working on a 10 page multi-page form, the form itself is working without a problem however, I have a 'back' button (using a link) set up on each page so should a user which to go back to change anything in the form they can. As this is confidential data I would really like to not save any of the information from the form in to the database and just keep it as being sent as an email.

I have changed the data provider in the Multipage action to {data:} and to {session:multipage} in the Section and and these now seems to save 'most' data however, the dates selected in the date picker default back to 20/07/2004 after clicking back which is incorrect as all dates selected in the test were in this year. Additionally, if you click back through all the way to the 1st page of the form, the data on this page is not saved in the session data. As this is just the 'load' section there is no room to add {session:multipage} as there is no section. Does anyone know how I can rectify these 2 issues?

I look forward to your response.

Best Regards
Donna
GreyHead 05 Jul, 2018
Hi Donna,

I have just replied to a similar post of yours.

For the date I think you may need to process the data so that the saved date is re-formatted to the display date format.

For the first page you can add a multi-page action but you may need to manage it to detect if this is a new submission or the user editing a new submission.

Bob
Dtorr1981 06 Jul, 2018
Hi Bob,

Thank you Bob with your guidance this seems to be working, I'm not sure how to detect if it is a new user or not though? I have tested by visiting the form from different browsers and this presents me with a blank form, is this sufficient to assume that the sessions are not being continued?

Best Regards
Donna
healyhatman 07 Jul, 2018
You could do an event switcher on the first page with the data source set to {session.empty:first_run} and if it is true then it's the first time the page has been run and you act accordingly. On the first submit event you use {session.set:first_run$1} to set the switch value.

Or you have a copy of the load event that does everything you want to do when it's not the first time you've run the form, and have the BACK button of the second page point to that event instead of the first event.
Dtorr1981 09 Jul, 2018
Hi Healyhatman,

Thank you for your response, this sounds exactly what I need.

I have added an event switched in the 'load' part of the settings and added the 'Display Section' to both A and B, I have then set the Data Provider for A to {session.empty:first_run} and for B to {session:multipage} is this correct so far?

As for the first button submit, is this the action on the design tab? Which field would I add that value?

Thank you for your support and patience.

Best Regards
Donna
Dtorr1981 18 Jul, 2018
Good Morning All,

Is anybody able to advise me on the event switcher queries mentioned above?

Regards
D
Dtorr1981 18 Jul, 2018
Thank you, please find form backup attached.

Regards
D[file=10777]Grant_Application_Form_18_Jul_2018_06_04_16.cf6bak.zip[/file]
healyhatman 18 Jul, 2018
No. The event switcher should have as its event the possible values of the data provider. In our case, that would be true or false. So instead of "A,B" it needs to say "true, false"
healyhatman 18 Jul, 2018
The data provider of the form should definitely NOT be "{session.empty:first_run}"

Under the "true" display section, data provider can be empty or set to {data:}
Under the "false" display section, data provider should be {session:multipage}
Dtorr1981 19 Jul, 2018
Thank you healyhatman,

I am still experiencing the issue however that if you click back to the first page of the form the data entries are not stored? I think I still may be missing something😟

I have updated the event switcher as mentioned above and included a backup below.

Thank you so much for your help with this, it is way beyond my knowledge.

Regards
D[file=10784]Grant_Application_Form_19_Jul_2018_05_29_08.cf6bak.zip[/file]
healyhatman 19 Jul, 2018
Theyre probably stored in the session, they won't automatically populate the form I don't think unless you tick the mix with global data checkbox. And make sure you multi-page action is BEFORE the display section action.
Dtorr1981 19 Jul, 2018
Thank you, I still must be doing something wrong as now my form doesn't show at all when I load the page. The page loads, but the form section is blank. I have included a screenshot of my settings below. I'm sure it must be something simple I am missing.

Thank you again. I'll be so glad to get this form finished.

healyhatman 19 Jul, 2018
Why did you set the data provider of the event switcher to {data:}?

It's {session.empty:first_run}
GreyHead 19 Jul, 2018
Hi Dtorr1981,

What is the code you are using in the Event SWitcher - I'm guessing that maybe it isn't returning 'true' or 'false'. That would explain the missing form.

Bob
Dtorr1981 19 Jul, 2018
Thanks Healyhatman, I missed that {session.empty:first_run} had to be the provider in the event switcher in your previous post.

@Greyhead - I haven't got any code in the Event Switcher, there isn't anywhere to add any code?

I'm still getting a blank form however, it did show the first time, so I'm guessing that the error may be the event switcher still. I have included a back up of my form. The live form can be viewed here.

​[file=10787]Grant_Application_Form_19_Jul_2018_06_39_54.cf6bak.zip[/file]
healyhatman 19 Jul, 2018
When he says "code" he means the data provider, the shortcode you have in there.
GreyHead 19 Jul, 2018
Hi Dtorr1981,

Apologies, my head is still working with CFv5 where you could add PHP directly. Does your {data:} return the strings 'true' or 'false'?

Bob
healyhatman 19 Jul, 2018
no he put it there accidentally Bob it's supposed to be {session.empty:first run}
Dtorr1981 19 Jul, 2018
Hi Guys, I have updated to {session.empty:first_run} on the Event switcher event and added {session.set:first_run$1} to the submit action under the value option - is this correct? My form is still blank so I will wait to see if the session times out after 15 mins.

I had previously omitted the {session.set:first_run$1} from the submit button.

Regards
D
healyhatman 19 Jul, 2018
If nothing is showing then one of your display section actions is wrong. And While developing you should have a debug action in each event. So one in load, one in submit, etc etc
This topic is locked and no more replies can be posted.