How it works
FormToWizard provide a fast and simple way to turn regular drupal form into a multistep wizard. It divides form by steps based on <fieldset>
elements. Legend is used to show Step name.
You can check test form after the module activation at: /admin/config/user-interface/form-to-wizard
Usage examples
drupal_get_wizard_form($form_id, $submit_button_element);
drupal_get_wizard_form('mymodule_example_form', 'submit');
function mymodule_example_form($form, &$form_state) {
$form = array(
// Regular drupal form definition
'submit' => array(
'#type' => 'submit',
'#value' => 'Submit'
)
);
return $form;
}
// before:
// drupal_get_form('mymodule_example_form');
// after:
drupal_get_wizard_form('mymodule_example_form', 'submit');
To be developed: Alternative usage (Not releaased yet!):
function mymodule_example_form($form, &$form_state) {
$form = array(
// Regular drupal form definition
);
$form['#type'] = 'wizard';
return $form;
}
drupal_get_form('mymodule_example_form');
To be developed: Configuration options
FormToWizard has several optional configuration options accessible on the module configuration page to make your life better:
Forward button: