I have a wizard where users need to fill out data. You cannot navigate to the second step until firs开发者_运维问答t step is completed.
I enforced this behavior by disabling/enabling "Next" button, but I really do not like this solution, since it seems not really elegant or safe here. What is the good approach on building step-by-step processes with enforcing step completion.
Thanks!
I think level of safety depends of logic requirements.
If user have to input some authorization information before second step(like PIN code) you can put this information(or some hash-code generated from this information) in cookies and validate cookies when second step is posted.
If user just have to input all required information before second step(like country name from first step is needed to generate states for second step) but have not done this and tries to post data for second step you can validate this sittuation on the second(or even last step) and generate exception or redirect on the first step.
精彩评论