I am working on a PHP project where the client wants multipage form data submitted. For instance, here is the process the form follows:
- Create new entity.
- Determine entity type.
- Fill in entity-specific fields.
On each page, the form is POSTed to the current page. Validation is performed server-side, and if validation is successful the user is redirected to the next step.
I’ve determined that, in order to keep track of the user’s progress, session data should be used. However, my concern is that, if the user opens two tabs and goes through the form in parallel, how can I keep track of what entity is being processed in each tab? Is this a scenario that can even be handled at all?
There are different 2 approaches.
If a user allowed to fill 2 forms at once, just add an unique identifier to each, and keep track them in the session.
If not – the things become simpler: just keep track of the steps passed and just show a warning in case of the previously passed step submitted.