I've built a pretty bulky form in cf5. Now and again there are problems with users whose data disappears during the filling process. As a solution to this problem, I would now like to build a form as a multipage form.
After each page, the data should be written to the database. Is that possible? Where can I find instructions?
I have built a save-data-action on each page and assigned the same model name. Nevertheless, individual database entries are generated for each page. But I need the data of all pages in the same database table.
After each page, the data should be written to the database. Is that possible? Where can I find instructions?
I have built a save-data-action on each page and assigned the same model name. Nevertheless, individual database entries are generated for each page. But I need the data of all pages in the same database table.
Hi hcohl,
I think that Max posted somewhere else that you need to get the new record ID after the first save and save that to the User session to be used in later submits+saves.
Bob
I think that Max posted somewhere else that you need to get the new record ID after the first save and save that to the User session to be used in later submits+saves.
Bob
Please - I need a detailed instruction:
in a multi-page-form: how to save each page individually without each save-data-action creating a new record.
I have built a save-data-action on each page and assigned the same model name. Nevertheless, individual database entries are generated for each page. But I need the data of all pages in the same database table.
- Must the "Model Name" be the same to all data-save-actions?
- Is the Data provider: {session:multipage} or {data:}?
- where to put the variable: {var:save_data??.data.aid}?
- in {var:save_data??data.aid} is ..._data??... the Model Name of the save-data-action of the event before?
in a multi-page-form: how to save each page individually without each save-data-action creating a new record.
I have built a save-data-action on each page and assigned the same model name. Nevertheless, individual database entries are generated for each page. But I need the data of all pages in the same database table.
- Must the "Model Name" be the same to all data-save-actions?
- Is the Data provider: {session:multipage} or {data:}?
- where to put the variable: {var:save_data??.data.aid}?
- in {var:save_data??data.aid} is ..._data??... the Model Name of the save-data-action of the event before?
Put a multipage action first.
Use a switch to check for {session.empty:identifer} - if it's empty, save a new one to session. Use {uuid:}.
Then do a read data, checking for an entry where identifier:{session:identifier}
In the "found" event put a save data action set to update, update condition where identifier:{session:identifier}
In the "not found" event put a save data action set to insert. Again, identifier:{session:identifier}
Use a switch to check for {session.empty:identifer} - if it's empty, save a new one to session. Use {uuid:}.
Then do a read data, checking for an entry where identifier:{session:identifier}
In the "found" event put a save data action set to update, update condition where identifier:{session:identifier}
In the "not found" event put a save data action set to insert. Again, identifier:{session:identifier}
Thank yor for your help. But I need more detailed instruction please:
- Where do I have to put the switch? In the load event?
- what does it mean: if it's empty, save a new one to session. Use {uuid:}.
- I have a problem with read data: there is no "found", only "notfound".
- Where do I have to put the switch? In the load event?
- what does it mean: if it's empty, save a new one to session. Use {uuid:}.
- I have a problem with read data: there is no "found", only "notfound".
For the read data: Click the gear icon, click events, tick the appropriate box.
For the switch (which you would need at the start of each submit event, just after a MultiPage action) you would have a switch with {session.empty:identifier} and the events would be true, false. When I say "use {uuid:}" I mean use a save to session action (if the switch event in the previous step is empty) called "identifier" with the data provider set to {uuid:} .
If that's still not clear enough you might need to read the instructions and look at the demo forms, or pay me to do it for you.
For the switch (which you would need at the start of each submit event, just after a MultiPage action) you would have a switch with {session.empty:identifier} and the events would be true, false. When I say "use {uuid:}" I mean use a save to session action (if the switch event in the previous step is empty) called "identifier" with the data provider set to {uuid:} .
If that's still not clear enough you might need to read the instructions and look at the demo forms, or pay me to do it for you.
This topic is locked and no more replies can be posted.