4d754b0077ee9aee379d6e176a540986b097f1fe
[freeside.git] / httemplate / elements / tr-checkbox-multiple.html
1 <% include('tr-td-label.html', @_ ) %>
2
3   <TD <% $style %>>
4
5 %   foreach my $option ( @{ $opt{options} } ) { #just arrayref for now
6
7       <INPUT TYPE  = "checkbox"
8              NAME  = "<% $opt{field} %>"
9              ID    = "<% $opt{id}.'_'.$option %>"
10              VALUE = "<% $option %>"
11              <% ref($value) && $value->{$option} || $value eq $option
12                   ? ' CHECKED' : ''
13              %>
14              <% $onchange %>
15
16       >&nbsp;<% $labels->{$option} %>
17
18       <BR>
19
20 %   }
21
22   </TD>
23
24 </TR>
25
26 <%init>
27
28 my %opt = @_;
29
30 my $onchange = $opt{'onchange'}
31                  ? 'onChange="'. $opt{'onchange'}. '(this)"'
32                  : '';
33
34 my $value = $opt{'curr_value'} || $opt{'value'};
35
36 $value = $opt{default_value} if $opt{default_value} && !defined($value);
37
38 my $labels = $opt{'option_labels'} || $opt{'labels'};
39
40 my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
41
42 </%init>