Buy Now
Sign in

Submit on 1st page then update on second page if further info is provided

WhiteLighter01 , October 05 2016
Answered
W
WhiteLighter01

Hi all,

I'm currently working on a subscribe form that has two pages on it. First page asks for name and email address which are required for the subscription, while the second page ask for added optional information like city, state, country, etc. What I'm trying to do is once the user finished the first page, the info gets recorded to the DB as the user moves to the second page. On the second page, where all the fields are optional, if the user provides additional info, the DB record that was created from the info provided from the first page gets updated with the additional info provided on the second page. How do I go on with this? what would be the best practice to achieve this?

Thanks

GreyHead

Hi WhiteLighter01,

Add a DB Save action in the Event that the first page submits to. then capture the ID of the new record and include that in a hidden variable in the next page. I suggest that you call the Primary Key column say cf_id as using id can cause problems.

Use Multi page actions to pass the data between the pages and give any 'repeated' inputs on the second page the same name as on the first. This should pre-load the values from the first page.

Then add a second DB Save linked to the same table in the event the second page submits to and this should them update the records.

I suggest that you test the methodology on a simple form with a couple of inputs to check that it does what you need before building the full version.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

W
WhiteLighter01

Thanks for the help. I was not able to test this for our product owner decided to make changes on the requirements.