The Multistep module adds multiple-step functionality to CCK forms. It does so by assigning a step number to each fieldgroup within the content type and hiding all the groups that do not belong to the current step. The user can then use different submitting buttons that will redirect to the previous, next, or current step.

The module also provides a block for each content type with a menu of the different groups within that form and a progress bar. This provides an easy way to jump to different steps throughout the form without having to go one by one as well as keeping track of the progress of the form.

Usage

Drupal 7

1. Go to “Manage fields” screen for this content type.
2. Add new (fields) groups, set the groups type to "Multistep: form step"
3. Move the fields into the groups.
4. Save content type.

Drupal 6

To use this module, go into the content type editing form in Administer >> Content management >> Content types and select the content type you want to enable the multistep for.

There will be a collapsed Multistep Form section below, mark it as Enabled and enter the amount of steps that you want this form to span.

Now, whenever you add or edit a group, you will be able to select which step that group belongs to. The group will only be shown when in that step, or in all of them if All is selected as an option.

If you are configuring multistep for a content type that already had data previously, you should go to Administer >> Site configuration >> Multistep and reset the table for that content type. This will create step data for all nodes that were previously created.

If you have a Taxonomy vocabulary set for the content type, you will see an option to set which step it should belong to in the content type editing form.

Configuring form settings

When you enable multistep for a node type, you can change several options that will affect different aspects of the form.

To remove/show the original buttons on the node editing form (Preview, Delete), go to the content type editing form in Administer >> Content management >> Content types and check/uncheck the box that says Hide standard buttons.

To change the text that appears on the different buttons of the form (Previous, Next, Save, Done), go to the admin settings page in Administer >> Site configuration >> Multistep and modify the values shown in the Navigation button labels section.

Form toggle

Users with the toggle multistep permission can select whether to view the entire form in a single page or the multistep form split over multiple pages. This is useful for vieweing a whole form at a glance before starting to enter the data.

You can also set whether the default display of the form is the multistep form or the entire form. Only users with the toggle multistep permissions will be able to switch displays.

Block: form index and progress bar

For each content type in which you enable multistep, a block will be created. This block will contain an index of all the fieldgroups in the form and a progress bar.

The index will allow the user to jump among the different parts of the form. If an item is displayed in italics, it means that the step that fieldgroup belongs to has not been submitted yet. This way the user can keep track of the sections of the form needed to complete it.

The progress bar, on the other hand, will display a bar that will grow with each step submitted. The percentage on the bar is calculated based on the number of steps that have been submitted and the total number of steps. It does not imply order.

You can configure the block to display either the index, the progress bar, or both.

Development

A hook is provided in case you want to override the status of a step when you submit a form. The hook would be implemented as:

hook_multistep_update_status(&$form_state, $status, $step) {
  // Write your own conditions
  switch ($step) {
    case 1:
      // if some condition
        $status = 'submitted';
      // else
        $status = 'unsubmitted';
      break;
    case 2:
      // etc...
  }
  return $status;
}

Where hook is the name of your module. This will allow you to set the $step of the node to the specificed $status at the time of submission. It should return the string of the status: the options are 'submitted' or 'unsubmitted'.

To perform modifications with techniques like form_alter on a particular step of multistep-enabled forms, use arg(3) to find out which step you're on. Example:
if (arg(3) && arg(3) == '2') { code to execute }

Third-party module integration

If you have a third-party module that defines fieldsets and you want them to integrate with Multistep, you have to implement hook_content_extra_fields() as follows:

/**
 * Implementation of hook_content_extra_fields().
 */
function mymodule_content_extra_fields($type_name) {
  $fields['field_my_module'] = array(
    'label' => t('My Module Weight'),
    'description' => t('My Module Form'),
    'weight' => 30,
  );
  return $fields;
}

Once implemented, you can change the step for that fieldset inside the Multistep options in the node type configuration.

Comments

btopro’s picture

Here's the snippet for getting this module integrated with a spaces based environment.

/**
* Implementation of hook_content_extra_fields().
*/
function YOURMODULENAME_content_extra_fields($type_name) {
  $fields['spaces_preset'] = array(
    'label' => t('Spaces Presets'),
    'description' => t('Spaces type'),
    'weight' => -10,
  );
  $fields['purl'] = array(
    'label' => t('Purl'),
    'description' => t('Persistent URL textfield'),
    'weight' => 0,
  );
  $fields['themes'] = array(
    'label' => t('Themes'),
    'description' => t('Theme setting from OG'),
    'weight' => 1,
  );
  return $fields;
}

Then it'll be available for use on the edit node form under admin/content/types/list

gerard ketuma’s picture

this module really helped me in figuring out a solution to one of my projects and saved me alot of time. kudos to the developer

finaukaufusi’s picture

Hi,

I read this module documentation and it explain what I want for my project.

I build my own custom module with it's content type.

Can I implement this module to work with my content type?

Many thanks

Finau

siva.thanush’s picture

Hi,
I don't have an option to enable the multistep for the content types.
When i went through the documentation I don't have it for d7.
I tried selecting Multistep:Form step in field group option but I couldn't.

Siva

dark_kz’s picture

Hello siva.thanush! Did you found solution? I don't see any option to enable multistep too

siva.thanush’s picture

See its not an option.
You have to do it like below.
Since there is no any detailed documentation i am putting it here.

a) Click on “Manage fields”.
b) The bottom of the screen will have the above options.
1. Create a new group.
2. Give the group name in “Add new group” and field name for the group.
3. Select the option “Multipage group” and click on “Save”.
c) After new multipage group created drag it and make it as the parent item of the form and save. Now, the whole form comes under a “Multipage group”.
d) Create another.
e) Select the widget as “Multipage” and save.
f) Same way create another Subgroup and select the Widget as “Multipage” ie., do the “d)” and “e)” again.
g) Now two sub groups are created.
h) Drag and drop “sub group1” to specific place. Since, the whole for is need to bring as multipage drop it next to “Multi site registration group”.
i) Do the same and drop the “subgroup2” to the specific place you need to go for the second page.
j) Make the “sub group1 and sub group2” as child for “Multisite registration group”. And other fields as a child to “sub group1 and sub group2”.(All the fields)
k) Now the form divided into two steps/Forms.

Note:
Unique Capatcha(if enabled) will occur in all the steps and The form will not complete without filling the mandatory fields.

Siva

xerolanam’s picture

Hi can anyone help me display horizontal tabs in my multistep form? similar to the display of fieldgroup module horizontal tab group. thanks.