in reply to how to define html::template for the following hash in perl/cgi
In your perl code you would just pass the add hash into the TemplateToolkit process routine.[% FOREACH element = add.keys %] [% IF add.$element.type == "text" %] <input type="text" name="[% add.$element.name %]" value="[% add.$e +lement.default %]"> [% ELSIF add.$element.type == "dropdown" %] <select name="[% add.$element.name %]"> [% FOREACH option = add.$element.value %] <option value="[% option %]"> [% option %] </option> [% END %] </select> [% END %] <br> [% # put a line break between the form elements %] [% END %]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to define html::template for the following hash in perl/cgi
by srins (Sexton) on Nov 05, 2005 at 20:03 UTC |