1 <% $opt{'prefix'} %><INPUT TYPE = "<% $opt{type} || 'text' %>"
2 NAME = "<% $opt{field} %>"
4 VALUE = "<% $value |h %>"
8 <% $opt{autocomplete} ? 'autocomplete="off"' : '' %>
11 ><% $opt{'postfix'} %>
16 my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
18 my $onchange = $opt{'onchange'}
19 ? join(' ', map $_.'="'. $opt{'onchange'}. '(this)"',
20 qw( onChange onKeyDown onKeyUp onKeyPress )
24 my $size = $opt{'size'}
25 ? 'SIZE="'. $opt{'size'}. '"'
28 my $maxlength = $opt{'maxlength'}
29 ? 'MAXLENGTH="'. $opt{'maxlength'}. '"'
32 $opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
33 if ref($opt{'disabled'}) eq 'CODE';
34 $opt{'disabled'} = 'DISABLED'
35 if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
37 my @style = ref($opt{'style'})
43 push @style, 'text-align: '. $opt{'text-align'}
44 if $opt{'text-align'};
46 push @style, 'background-color: #dddddd'
47 if $opt{'disabled'} && ! $opt{'nodarken_disabled'};
49 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';