summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-checkbox.html
blob: ed166502b306b3262d4469337693e903b66d22d3 (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
41
42
43
44
45
46
47
48
49
<%doc>

Example:

  <& /elements/tr-checkbox.html,
       'label' => 'Do or do not',
       'field' => 'field_name',
       'value' => 'Y',
  &>

</%doc>
% if ( $opt{'box_first'} ) {
  <TR>
    <TH COLSPAN="<% $opt{'colspan'} || 2 %>"
      VALIGN = "<% $opt{'valign'} || 'top' %>"
      STYLE  = "<% $style %>"
      ID     = "<% $opt{label_id} || $opt{id}. '_label0' %>"
    >
      <& checkbox.html, @_ &>
      <% $required %><% $opt{label} %>
    </TH>
  </TR>
% } else {
<& tr-td-label.html, @_ &>

  <TD <% $style %>>
    <% include('checkbox.html', @_) %>
  </TD>

</TR>
% }

<%init>

my %opt = @_;

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

my $style = 'text-align: left; padding-top: 3px';
$style .= '; '. $opt{'cell_style'} if $opt{'cell_style'};

my $required = $opt{'required'} ? '<font color="#ff0000">*</font>&nbsp;' : '';
if ($required) {
  $style .= ';font-weight: bold';
}

</%init>