FAQ

John Lifsey - Contractor - wrote:

It may be covered by your callback idea, but if I were using it I'm
sure I would want to arrange the form how I liked (or more correctly,
someone with a clue about interface would arrange it). Would something
like this be possible?

[% form.start %]
<table><tr><td>Your email address:</td><td>[% form.email
%]</td></tr></table>
[% form.stop %]

So that formmanager (gener/valid)ates the form elements, but the
structure can be changed?

The CGI::FormManager::Form package has two default TT2 templates - one
for the fill-in form (with or without error messages) and the other for
the confirmation form, however you can specify your own templates:

my $fmgr = CGI::FormManager->new({}, { template => $mytemplate,

confirm_template => $myconfirmtemplate });
# add a form using our own templates
my $form1 = $fmgr->form(myform1 => { elements => [ .. ] } );
# add another form using another pair of templates
my $form1 = $fmgr->form(myform2 => { elements => [ .. ],

options => { template => $mytemplate2,

confirm_temlate => ... } );

The other thing is that the elements of the default templates are
labelled with classes, so that you should be able to adapt the styling
quite precisely using CSS.

Of course there are issues like the ordering of fields and literal text
within the form that might be up for discussion between the interface
designer and the programmer, and this module sticks such things in the
code. Maybe I could separate out the definition of the form fields, and
the definition of the ordering of the fields within the form. I'll
think about this.

Regards
Andrew

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 8 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedNov 22, '05 at 1:12p
activeNov 22, '05 at 8:06p
posts8
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase