By jfberroyer on
Hello,
I would like to know if it was possible in Drupal 6 to do a multistep form using hook_form ? There is a node type that I have defined, so I would like to use hook_form to display the node editing form, but I want to add other informations that have to be stored in another table and that need to use a multistep form. The problem is that all documentation I have found on multistep form say that I have to use $form_state, the first parameter of the function that generate the form, but the fact is that the first parameter of hook_form is &$node, so how can I do ?
Thanks for your help !
Jeff
Comments
Hi
Hi,
Send your mail id
Thanks,
Raj.
It seems that the poll
It seems that the poll module in drupal core uses such a multistep node form. I'm gonna see in the code how it works.
The $form_state is passed as second parameter to the hook form of which prototype, line 184, is:
function poll_form(&$node, $form_state) { ...
simple multiform node creation example drupal 6
Hy,
I have created a simple example illustrating a multistep node creation form. The code defines a node type 'test' (don't forget the info file), that is created in two steps. I use the devel module to output some variables, to illustrate where in the form 'lifecycle' we are.
It seems to work for me. Let me know if this is working for you or if you would suggest some better examples.
UPDATE (4/08): I have added a check in the form alter in order to only do the altering for the test form.
Great! works perfectly!
Great! works perfectly!
But one question if I want make a some file field in first step how to save it?