I'm trying to build a multistep form (a.k.a. "wizard"). The excellent guide of Jeff Eaton http://drupal.org/node/101707 (http://drupal.org/node/101707) about how to do such a form, relates only to a user-supplied form (you need to write a special module for it). I wonder if there's a way to do the same thing with a CCK form. Here are the issues I ran into so far:
There are two things that need to be done:
1. Setting the current step index (1,2,3.../first,second,last etc.) 2. Determining which step we're at, to decide which form fields to present, or which action to perform, upon submitting.
To set the current step index, Eaton uses the $form_values array which is automaticaly added to a multistep form. He's doing so in the form building function (/function my_form/), with the aid of $form_values. This way he assures the step won't be increased until proper validation. If I want to do the same thing on an existing form, I'd have to use hook_form_alter. The thing is $form_values is not available to hook_node_alter...
Hook_submit is used by Eaton to check on which step we are currently at, and act upon it. The equivalent in the case of altering a form, would be to use hook_nodeapi, during the submit operation. But then again - I think I can't really hold the process, only add things to it.
So basicaly I'm asking: *Is there a different way to modify a CCK, so it will become a multistep form?*
Zohar
On Jan 30, 2007, at 4:55 PM, Zohar Stolar wrote:
So basicaly I'm asking: *Is there a different way to modify a CCK, so it will become a multistep form?*
Don't know the answer to your question and I haven't used this, but you may want to check out http://drupal.org/project/wizard if you haven't seen it yet.
Ray Zimmerman wrote:
On Jan 30, 2007, at 4:55 PM, Zohar Stolar wrote:
So basicaly I'm asking: *Is there a different way to modify a CCK, so it will become a multistep form?*
Don't know the answer to your question and I haven't used this, but you may want to check out http://drupal.org/project/wizard if you haven't seen it yet.
I should have mentioned that I'm looking for a Drupal 5 solution.
The wizard module, which seems wonderful BTW, is for Drupal 4.7, and it doesn't seem to use the new Form API, where multistep forms are built-in.
What I'm aiming at, is somehow altering the CCK form, to be a multistep one, what seem to me possible only for customed (e.g. module provided) forms.
Thanks anyway!
I am trying to create a settings "Wizard" for my site. This would take them to at least one page which has all the fields from the edit profile page (including sub-pages) and hopefully also the settings page for the mysite module.
this is very similar to the show fields on registration form function, but the users are (necessarily) generated by an administrator, so I can't use the the registration form function of the profile module. I've tried a few different things - making a php page based on the profile page for example with some liberal cutting and pasting - but I was wondering if anyone else had attempted something similar and could give me some pointers.
Thanks Jon Vile