Custom Drupal 6 Multistep Form Wizard

I'm starting on my second major version of a custom D6 multistep form-based module with a few interesting requirements, particularly:

  1. The "form" is three steps--but the last step is not a form, it is a simple confirmation page or a redirect to any admin configurable page with a confirmation message.
  2. With enough information, Step 1 can be skipped
  3. A node will be created upon successful submission of Step 1, and the same node will be updated upon successfully submission of Step 2.

I call it a form, but it's really a wizard with two forms and one confirmation page.  So I'll call it a wizard.

Step 1 form has only a few simple fields (two of which are dependent upon another, BTW).  When the field values/selections are known, they should be passed to a special URL which handles submitting the Step 1 form behind the scenes, and, after passing validation, land the user on the Step 2 form (or back on Step 1 if validation doesn't pass).

Tools used:

  • Drupal 6
  • ctools object cache
  • form building function(s)
  • custom 'wizard' (not ctools', because it's not AHAH-friendly)
  • drupal_execute();
  • as much OOP as possible (because it's just so clean).

... fast forward. I'll eventually write more about it here, but for now: Module here. Demo here. Jump past Step 1 here.