I have a very complicated form which has multiple “stages” in it.
Each stage has forms where the user adds indefinite numbers of rows. Each time the user clicks “continue” these forms save to the database (each “stage” has its own table in the database) and the next stage is shown.
I’m worried about users pressing “back” in order to get the the previous form (if they’ve made a mistake or something).
The only three ways I can think to solve this problem is:
- Disallow people to press back. If they do send them straight to the first form to start again.
- Check the database when the form page is requested. If there are rows already then delete those rows and start the user again on the form they’re on.
- [potential – This is going to be harder because I’m using codeigniter’s form_validation library] Check the database when users press back. Get any current values out and put into the form as default values. Then on submit, remove any rows and replace with form values.
How do you guys do this kind of form? Its getting really ridiculous the amount of logic just for some forms! haha, is there a better way to do this? I suspect that number 3 above is the best option?
Thanks
I have used the third option on various occasions, though depending on the size of the form, this can certainly get overwhelming, not to mention the fact that I haven’t used CodeIgniter’s validation before.
Many issues arise from the first two options that should be avoided if possible [Including, but not limited to: Mistakes that aren’t able to be corrected, hairy database logic, etc.], but the reward of having happy users is invaluable.
Hope this helps!
Mason
To give a visual summary of what users may think if they can’t go back, I have included this image.
http://momentumshift.com/wp-content/uploads/2011/05/senior_woman_using_computer_mon142089.jpg