enclose fields into divs

14 views
Skip to first unread message

fb_neuling

unread,
Sep 23, 2011, 6:51:26 AM9/23/11
to perl-formbuilder
Hello!
I need to enclose the fields with labels, etc into a div.
How can I do that ?

example:
$form->field(name => 'email', size => 60, required => 1);
$form->field(name => 'email2', size => 60, required => 1);
the html output should be

<div class="span-8"> <input type="text" name="email" size="60">Email </
div>
<div class="span-8"> <input type="text" name="email2" size="60">Email
</div>

Thanks a lot

Wolfgang Radke

unread,
Sep 23, 2011, 8:10:12 AM9/23/11
to perl-for...@googlegroups.com
Hi 'Neuling',

did you ever use Templates before? That is the way I do it.

If not, you might have to output the additional tags ('span', ... 'etc.')
by yourself.
At least that is the way i would do it.

Wolfgang


Am 23.09.2011, 12:51 Uhr, schrieb fb_neuling
<ruben....@googlemail.com>:

fb_neuling

unread,
Sep 24, 2011, 4:52:28 PM9/24/11
to perl-formbuilder
Hi!
Ok . I think, i need to migrate to templates. maybe tt2 :-)
No one ask more.
Can i import the state from form config to text ?
For example:
#!/usr/bin/perl

use CGI::FormBuilder;

@fields = qw(first_name last_name email phone);

$form = CGI::FormBuilder->new(
fields => \@fields,
);
... and then ...
$form->write_module('MyForm'); ## don't work for me

Thanks a lot

On 23 Sep., 14:10, "Wolfgang Radke" <wora1...@googlemail.com> wrote:
> Hi 'Neuling',
>
> did you ever use Templates before? That is the way I do it.
>
> If not, you might have to output the additional tags ('span', ... 'etc.')  
> by yourself.
> At least that is the way i would do it.
>
> Wolfgang
>
> Am 23.09.2011, 12:51 Uhr, schrieb fb_neuling  
> <ruben.more...@googlemail.com>:

Wolfgang Radke

unread,
Sep 25, 2011, 3:10:33 AM9/25/11
to perl-for...@googlegroups.com
Hi Neuling,

Muttersprache Deutsch? Wäre evtl. einfacher zu erklären.

If you do templates, you should do it right.

a) Use CGI::FormBuilder::Source - submodules (File, YAML or Perl)
b) Use your own code for changes during runtime (like default values, )
c) Use Template (I use tt2) for the output

Works like a charm inside frameworks like Catalyst (which has its own
learning curve!)

Wolfgang


Am 24.09.2011, 22:52 Uhr, schrieb fb_neuling
<ruben....@googlemail.com>:

Reply all
Reply to author
Forward
0 new messages