NAME

HTML::FormHandler::Manual::Templates - using templates

SYNOPSIS

Documentation on templates to use with HTML::FormHandler

In progress...

Using templates

Sample templates

Text input field

<label class="label" for="[% f.name %]">[% f.label %]</label>
<input type="text" name="[% f.name %]" id="[% f.name %]" value="[% f.fif %]">

Select field

Single select:

<label class="label" for="[% f.name %]">[% f.label %]</label>
<select name="[% f.name %]">
  [% FOR option IN f.options %]
    <option value="[% option.value %]" 
    [% IF option.value == f.fif %]
       selected="selected"
    [% END %]>
    [% option.label %]</option>
  [% END %] 
</select>

Multiple select:

<label class="label" for="[% f.name %]">[% f.label || f.name %]</label>
<select name="[% f.name %]" multiple="multiple" size="5">
  [% FOR option IN f.options %]
    <option value="[% option.value %]" 
    [% FOREACH optval IN f.value %]
       [% IF optval == option.value %]
          selected="selected"
       [% END %]
    [% END %]>
    [% option.label %]</option>
  [% END %] 
</select>

Checkbox

<input type="checkbox" name="[% f.name %]" value="1"
    [% IF f.fif == 1 %] checked="checked"[% END %] />

AUTHOR

Gerda Shank, gshank@cpan.org

COPYRIGHT

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.