summaryrefslogtreecommitdiff
path: root/httemplate/elements/checkbox.html
blob: 91efe85782c2624629d13abcd6d0998d0879c8c3 (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
<% $opt{'prefix'} %><INPUT TYPE  = "checkbox"
                           NAME  = "<% $opt{field} %>"
                           ID    = "<% $opt{id} %>"
                           VALUE = "<% $opt{value} %>"
                           <% $opt{curr_value} eq $opt{value}
                                ? ' CHECKED'
                                : ''
                           %>
                           <% $opt{disabled} %>
                           <% $onchange %>
                    ><% $opt{'postfix'} %>
<%init>

my %opt = @_;

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

$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
  if ref($opt{'disabled'}) eq 'CODE';
$opt{'disabled'} = 'DISABLED'
  if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?

</%init>