summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-checkbox-multiple.html
blob: bb90a820b2cacd6251556654b5ac2c6d0222fdec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<% include('tr-td-label.html', @_ ) %>

  <TD <% $style %>>

%   foreach my $option ( @{ $opt{options} } ) { #just arrayref for now

      <INPUT TYPE  = "checkbox"
             NAME  = "<% $opt{field} %>"
             ID    = "<% $opt{id}.'_'.$option %>"
             VALUE = "<% $option %>"
             <% ref($value) && $value->{$option} || $value eq $option
                  ? ' CHECKED' : ''
             %>
             <% $onchange %>

      >&nbsp;<% $labels->{$option} %>

      <BR>

%   }

  </TD>

</TR>

<%init>

my %opt = @_;

my $onchange = $opt{'onchange'}
                 ? 'onChange="'. $opt{'onchange'}. '(this)"'
                 : '';

my $value = $opt{'curr_value'} || $opt{'value'};

my $labels = $opt{'option_labels'} || $opt{'labels'};

my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';

</%init>