1 % unless ( $opt{'js_only'} ) {
3 <SELECT NAME = "<% $opt{field} %>"
5 previousValue = "<% $curr_value %>"
6 previousText = "<% $labels->{$curr_value} || $curr_value %>"
13 % if ( $opt{options} ) {
15 % foreach my $option ( @{ $opt{options} } ) { #just arrayref for now
17 <OPTION VALUE="<% $option %>"
18 <% $opt{curr_value} eq $option ? 'SELECTED' : '' %>
20 <% $labels->{$option} || $option %>
25 % } else { #deprecated weird value hashref used only by reason.html
27 % my $aref = $opt{'value'}->{'values'};
28 % my $vkey = $opt{'value'}->{'vcolumn'};
29 % my $ckey = $opt{'value'}->{'ccolumn'};
30 % foreach my $v (@$aref) {
32 <OPTION VALUE="<% $v->$vkey %>"
33 <% ($opt{curr_value} eq $v->$vkey) ? 'SELECTED' : '' %>
49 my $labels = $opt{'option_labels'} || $opt{'labels'};
51 my $curr_value = $opt{'curr_value'};
54 if ( $opt{'onchange'} ) {
55 $onchange = $opt{'onchange'};
56 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
57 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
58 #callbacks should act the same
59 $onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
62 $opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
63 if ref($opt{'disabled'}) eq 'CODE';
64 $opt{'disabled'} = 'DISABLED'
65 if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
67 my @style = ref($opt{'style'})
73 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
75 my $size = $opt{'size'} ? 'SIZE='.$opt{'size'} : '';