3 Feb 20:14
[FormBuilder] Multipage forms in Catalyst
From: José Parrella <joseparrella <at> gmail.com>
Subject: [FormBuilder] Multipage forms in Catalyst
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-03 19:16:40 GMT
Subject: [FormBuilder] Multipage forms in Catalyst
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-03 19:16:40 GMT
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)
RSS Feed