1 % unless ( $opt{'js_only'} ) {
3 <SELECT NAME = "<% $opt{field} %>"
5 previousValue = "<% $curr_value %>"
6 previousText = "<% $labels->{$curr_value} || $curr_value %>"
12 % if ( $opt{options} ) {
14 % foreach my $option ( @{ $opt{options} } ) { #just arrayref for now
16 <OPTION VALUE="<% $option %>"
17 <% $opt{curr_value} eq $option ? 'SELECTED' : '' %>
19 <% $labels->{$option} || $option %>
24 % } else { #deprecated weird value hashref used only by reason.html
26 % my $aref = $opt{'value'}->{'values'};
27 % my $vkey = $opt{'value'}->{'vcolumn'};
28 % my $ckey = $opt{'value'}->{'ccolumn'};
29 % foreach my $v (@$aref) {
31 <OPTION VALUE="<% $v->$vkey %>"
32 <% ($opt{curr_value} eq $v->$vkey) ? 'SELECTED' : '' %>
48 my $labels = $opt{'option_labels'} || $opt{'labels'};
50 my $curr_value = $opt{'curr_value'};
53 if ( $opt{'onchange'} ) {
54 $onchange = $opt{'onchange'};
55 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
56 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
57 #callbacks should act the same
58 $onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
61 $opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
62 if ref($opt{'disabled'}) eq 'CODE';
63 $opt{'disabled'} = 'DISABLED'
64 if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
66 my @style = ref($opt{'style'})
72 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';