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