José Parrella | 3 Feb 20:14
Picon

[FormBuilder] Multipage forms in Catalyst

Greetings,

I've been trying to setup a few sites which need to implement multipage
forms, under Catalyst. I've read the tutorial in formbuilder.org
regarding multipage forms, and I've tried two different ways for this:

1) Setting up the first page is easy with C::Plugin::FB, and the
YAML-based source files. Therefore I use a single Local Form method in
Catalyst, and the form posts to itself. My whole method is a:

if ($c->form->submitted && $c->form->validate) {
     ... actions
}

Since I'm taking profit of the fact that using TT2, the template name is
setup by default to /root/≤path>.tt2. When the user is entering the
first page, $c->form isn't submitted nor validated, and it opens the
default template, which has a single form.render and "calls" the .fb
file to get the form configuration. Nice.

Of course, when a user enters some information and submits the form, I
get into my if statement (the form is submitted and validates), and I
can do all my DB stuff, etc. But if I want a second form to show up, I
can't set a particular .fb source file (so I can't set my second form
configuration), and the $c->form object is already filled with previous
information.

Using state parameters (such as "add", "show", etc.), doesn't help me
since I still can't call a particular source file.

(Continue reading)

Nate Wiger | 6 Feb 18:15
Picon

Re: [FormBuilder] Multipage forms in Catalyst

Jose-

You should check out the Catalyst FormBuilder Controller, instead of
the plugin. The plugin I wrote had some issues, and I believe this is
one of them. Try the Controller base class (which is maintained by the
Catalyst core team) and see if that solves it.

Cheers,
Nate
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane