ID = "<% $opt{id} %>"
previousValue = "<% $curr_value %>"
previousText = "<% $labels->{$curr_value} || $curr_value %>"
+ <% $multiple %>
+ <% $size %>
+ <% $style %>
+ <% $opt{disabled} %>
<% $onchange %>
+ <% $opt{'element_etc'} %>
>
% if ( $opt{options} ) {
<%init>
my %opt = @_;
-warn "SELECT.HTML: ". join ' / ', %opt;
-
-my $onchange = $opt{'onchange'}
- ? 'onChange="'. $opt{'onchange'}. '(this)"'
- : '';
my $labels = $opt{'option_labels'} || $opt{'labels'};
$onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
}
+$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
+ if ref($opt{'disabled'}) eq 'CODE';
+$opt{'disabled'} = 'DISABLED'
+ if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
+
+my @style = ref($opt{'style'})
+ ? @{ $opt{'style'} }
+ : $opt{'style'}
+ ? ( $opt{'style'} )
+ : ();
+
+my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
+
+my $size = $opt{'size'} ? 'SIZE='.$opt{'size'} : '';
+
+my $multiple = $opt{'multiple'} ? 'MULTIPLE' : '';
+
</%init>