1 <% $opt{'prefix'} %><INPUT TYPE = "text"
2 NAME = "<% $opt{field} %>"
4 VALUE = "<% $value |h %>"
8 <% $opt{autocomplete} ? 'autocomplete="off"' : '' %>
11 ><SELECT NAME = "<% $opt{field} %>_units"
12 ID = "<% $opt{id} %>_units"
13 onChange = "<% $opt{field} %>_units_changed(this)"
15 <OPTION VALUE="1">minutes</OPTION>
16 <OPTION SELECTED VALUE="60">hours</OPTION>
17 </SELECT><% $opt{'postfix'} %>
18 <SCRIPT TYPE="text/javascript">
19 function <% $opt{field} %>_units_changed(what) {
20 var units = what.options[what.selectedIndex].value;
21 if ( units == 60 ) { // changed from minutes to hours, so /60
23 var value = what.form.<% $opt{field} %>.value;
25 what.form.<% $opt{field} %>.value = value;
27 } else if ( units == 1 ) { // changed from hours to minutes, so *60
29 var value = what.form.<% $opt{field} %>.value;
30 value = Math.round(value * 60);
31 what.form.<% $opt{field} %>.value = value;
40 my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
43 my $onchange = $opt{'onchange'}
44 ? join(' ', map $_.'="'. $opt{'onchange'}. '(this)"',
45 qw( onChange onKeyDown onKeyUp onKeyPress )
50 my $size = 'SIZE="'. $opt{'size'}. '"';
52 $opt{'maxlength'} ||= 3;
53 my $maxlength = 'MAXLENGTH="'. $opt{'maxlength'}. '"';
55 $opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
56 if ref($opt{'disabled'}) eq 'CODE';
57 $opt{'disabled'} = 'DISABLED'
58 if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
60 my @style = ref($opt{'style'})
66 push @style, 'text-align: '. $opt{'text-align'}
67 if $opt{'text-align'};
69 push @style, 'background-color: #dddddd'
70 if $opt{'disabled'} && ! $opt{'nodarken_disabled'};
72 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';