There are three main approaches to creating multi-step forms in Drupal:
1) Using jQuery plugins which wrap form elements in HTML for each step but don't integrate with server-side validation.
2) Using pagebreaks in Webforms which provides a simple way to divide forms into steps with validation at each step.
3) Leveraging Drupal 7's improved Form API which allows data to persist across pages through $form_state, enabling complex multi-step forms with conditional logic and gathering final submission data.
1 of 9
Downloaded 11 times
More Related Content
Multistep form
1. The Web A-Team ...5, 6, 7... A Journey Through Drupal Multi-Step Forms Vamory TRAORE Technical Manager
11. 1) Using Jquery plugins Various solutions based around the same concept, wrapping elements for each step around markup: <fieldset>STEP 1</fieldset><fieldset>STEP 2</fieldset> Adding navigational elements, hiding form elements upon users request
12. A few examples (not applied to Drupal though): Form Wizard: http://thecodemine.org/
13. How to Create A Multi-Step Signup Form With CSS3 and jQuery: http://webexpedition18.com/articles/how-to-create-a-multi-step-signup-form-with-css3-and-jquery/
25. 3) Form API In Drupal 7, the new Form API makes multi step forms easy to develop
26. Thanks to better data persistance and ability to add custom values to $form_state , no need to hack a form to create multistep forms: The form step is saved in a value to handle navigation through pages: $form_state['page_num'] = 1
27. Submit buttons are used to control which part of the form to be displayed
29. 3) Form API Using the same logic, it is possible to chain forms together and go beyond multistep forms: By creating specific forms with custom validation function at each steps