I haven't found many examples of multistep forms in Drupal 6. I know they implement a new system for this in 6 but I have yet to stumble across any information about it outside of the Drupal API, which is not always as descriptive as I would like. Any help would be appreciated.

Comments

manesh’s picture

I am having the same problem!

I found some good D5 guides, but I need something for D6!

TapocoL’s picture

Hopefully this will be helpful, if you haven't stumbled acrossed it already.

http://drupal.org/node/144132#multistep

-Craig Jackson
-Web Developer

manesh’s picture

Thanks Craig - however I already saw that and it doesnt really give a good example of how to do a multi step form.

TapocoL’s picture

I don't have time to test this. But, looking over the last link I gave you. Can you increment a $form_state['step']++ each time the form gets submitted. And then place the 'step' as a value in the form to be passed to submit again to be incremented. Just set step equal to 1 if (empty($form_state['step'])) on the form creation function. It looks like drupal will pass the $form_state variable from submit to the creation form, as long as you don't redirect the user. Let me know if this works.

-Craig Jackson
-Web Developer

heather’s picture

jcarreer- did you find any examples of multi-step forms for Drupal 6? do you have one to offer?

chriscohen’s picture

Check out Andrew Yager's post for a simple multistep form example for Drupal 6.

http://www.andrewyager.com/content/view/51/27/

sebnor’s picture

Here is the updated url to his blogpost about multi-step forms:

http://www.andrewyager.com/blog/2008-06-03/drupal-6-multistep-forms

matslats’s picture

Not satisfied with any of the above examples, I made my own, simplest possible multistep form example

houen’s picture

sidrasultana’s picture

yes it is a complete functional example of multistep form in drupal 6

Brainz-2’s picture

Is there a way to limit the checkbox option to example max 2 or 3. Like te #required option.

$form['questions']['q0'] = array(
'#type' => 'checkboxes',
'#title' => '',//t('Dit vind ik mooi'),
'#default_value' => $_SESSION['woonid']['q0'],
'#options' => array()
);