Wizard

Last updated on
24 April 2025

Proposed by: chx

Form API has serious multistep capabilities but still there problems. I would like to see the existing features documented, example and support code added, and where needed, even core patches submitted. The ultimate goal is to be able to write things like a multi page wizard form effortlessly.

Note: interested Drupal developers should add goals, and flesh out this project.

Note2: Most probably this is not for someone who has not developed for Drupal before.

Current issues

  1. Proper handling of checkbox default values past stage 1: Currently for checkboxes, you cannot pass a default value to a new form element past stage one. For example, if stage two of the form adds a new set of checkboxes, you are unable to have any selected by default.
  2. Validation logic too complicated: The validation setup for FAPI is designed for single submission forms in mind primarily. Having to rebuild the form prior to validation in multistep scenarios makes multistep validation a nightmare.
  3. Navigation: forward and back action buttons need to be programmed per multistep form. The API should probably provide a navigation mechanism.

Karoly Negyesi (chx) will be the leading mentor of this project.

Comments on this proposal

RE: Wizard
diego_miola - March 2, 2007 - 15:02

I've been working on a solution for this topic. I've made a wizard using FAPI adding just a few lines of javascript.

The prototype is working great, so in a few days I'll post some code so you can test it.

Sorry for my english.

Diego - Buenos Aires Argentina
======================================================
======================================================

Not really acceptable
chx - March 16, 2007 - 11:03

Drupal policy is that things should be operational even if JS is disabled.

And most of the problems above are not addressable by a "few lines of JS" as they are PHP related.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile. | Blog about life in Hungary
======================================================
======================================================

Sounds good...
coofercat - March 19, 2007 - 15:51

After going around and around with various examples here and on the Internet, I got wizard functionality working quite nicely. I wrote this article on FAPI and Wizards for my company, but I thought maybe a module would be a good way to make wizards easy to use throughout.

Whilst I haven't really attempted a design, much less any code, I'm struggling to see how 'wizard.module' would add a great deal that less sophisticated solutions allow for (FAPI does such a lot, there's not much left to do). I'm looking forward to seeing how these problems get solved, and how it'll all work in the end!
======================================================
======================================================

default values for checkboxes past stage 1
stella - June 5, 2007 - 06:29

Is there any workaround for setting default values for checkboxes after stage 1 of a multi-part form? This would be extremely useful for my module.
======================================================
======================================================

Maybe of Use
coofercat - June 8, 2007 - 10:34

I have published a module and some doco for my company. It's here:
http://www.pre-emptive.net/doco/drupal-5-wizard-api-module

It does many of the things required by this proposal, although with Drupal 5.1 runs into a few bugs which cause problems for heavy use of wizard forms.

Once some more doco is done, I'll be looking at a Drupal 6 version of this module. We have a "transitional" version already working, and it's looking good so far. More on that as it comes...
======================================================
======================================================

Help improve this page

Page status: Not set

You can: