Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2010 at 13:26 UTC
Updated:
30 May 2011 at 16:31 UTC
I have been using the multistep form wizard for a project and it works great. However, I have noticed that there is a way to define a callback for all the buttons except for the back button. I would like to have a way to define a callback for the back button so that if a user fills in the page of the form that they are on, then decides to move backwards, the values that they just filled in will save. Right now the values are only stored when the users moves forward through the form. Thanks!
Comments
Comment #1
merlinofchaos commentedThere is one. You set it via 'back callback'.
Comment #3
bspot commentedI don't know whether this worked in 6.x-1.3, but it doesn't work in 6.x-1.8:
In wizard.inc:248, the
#wizard typeattribute of the back button is set tonext.Hence, when using the back button, the
next callbackwill be called instead of theback callback.Is this on purpose or just a typo?
Comment #4
merlinofchaos commentedOh, heh. I'd forgotten I'd done it that way.
In that case, you can easily check $form_state['clicked_button'] to see which button was pressed, and act appropriately.
They both use the 'next' callback because in every use case I've ever had, they act the same, except that 'back' doesn't submit or validate.