[Zope] A Really Smart Form Chain

Thomas B. Passin tpassin@mitretek.org
Tue, 13 Nov 2001 17:37:02 -0500


If you are willing to use frames and javascript, put your wizard-like forms
in one frame, and in another put javascript to save their data and move to
the next form.  It shouldn't be too hard to set up your wizard chain.  You
might, for example, use one array for the data from each form.  If the user
moves backwards, you would reload the corresponding page in the forms frame,
then re-populate it from the data you stored in the other frame.

When it's time to submit the form, stuff all the variables into hidden
fields of one more form (invisible because all its fields are hidden) and
submit that form using javascript.

Another approach is to use styles - you can hide one form by setting its
visibility property to "hidden", then move another into its place by
adjusting its position. This will not work on version 4 or earlier browsers,
though.  And of course it requires the use of javascript too (which I don't
have any problem about but some people do).

Cheers,

Tom P

[Harlow Pinson]
>
> I'm probably missing some key step not mentioned in the
> wizard_keys document.  Are there any examples of this in action,
> i.e a form chain with more than three steps?
>
> This method seems to collect all the form variable information in a
> fowardly direction just fine, but as soon as you start going
> backward more than a step, and then forward again, i.e.
> resubmitting a form in the chain, the current field information get's
> clobbered for the user, and they have to enter it again.  I've been
> able to load the field info into the textarea value attributes as a
> workaround, but this does not seem to work for form select
> objects, and the form output turns into a lists of values which I then
> have to strip, and is getting awfully complicated.
>
> I'll take a look at the Marshalling example.  Thanks!
>