in reply to html::template with dynamic checkbox
You have to prepare the data inside your script:
my @checkboxes = (); my $checked = 3; for (1 .. 5){ my %rowh = ( name => "desc_$_" , description => "description ($_) ", ) if ($checked == $_) { $rowh{checked} = 1; } push @checkboxes, \%rowh }
And in the template:
<TMPL_LOOP NAME=CHECKBOX_HEADER> <input type="checkbox" name="<TMPL_VAR NAME=name>" <TMPL_IF NAME=checked>checked="checked"</TMPL_IF>> <TMPL_VAR NAME=description</TMPL_VAR></input> </TMPL_LOOP>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML::Template with dynamic checkbox
by adrive (Scribe) on Sep 12, 2007 at 09:02 UTC |