You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine you have a form with ten steps and then you want to add a step between 2nd and 3rd. The easiest way would be to call it step 2.5, otherwise if you want to call it step 3 it means you have to rename all existing steps and form action inside them and other things that depend on step number, incrementing them all by one. Lots of work with possibility of breaking things. Why don't we simply get the next step a form should direct to from a hidden field inside that step? Wouldn't it make steps more modular and changes easier?
<input type="hidden" name="nextstep" value="3" />
The text was updated successfully, but these errors were encountered:
I went ahead and made the change in a new branch here: 0361e68
I think this can also help us with implementing sub-steps. However we still need to fix the code for navigation to support this. I suggest that instead of a "TOTAL_STEPS" variable we use an array like this:
STEPS = [1, 2, 2.5, 3, 4];
Then we can loop through this array to generate markup for navigation links. Do you agree?
I don't like this line:
$nextStep = 'form.php?step=' . ($step + 1);
Imagine you have a form with ten steps and then you want to add a step between 2nd and 3rd. The easiest way would be to call it step 2.5, otherwise if you want to call it step 3 it means you have to rename all existing steps and form action inside them and other things that depend on step number, incrementing them all by one. Lots of work with possibility of breaking things. Why don't we simply get the next step a form should direct to from a hidden field inside that step? Wouldn't it make steps more modular and changes easier?
<input type="hidden" name="nextstep" value="3" />
The text was updated successfully, but these errors were encountered: