X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Felements%2Fselect.html;h=59010c140c0e0c01e92732dfcedb47a74b4eae3b;hb=ca564d6930f7d65d831d148701ba8ab316eb46e5;hp=268e0d243b0294c701d044315c78f3648834fb34;hpb=51d08ea7a5f0d07185c683db7a65722f4ebea781;p=freeside.git diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index 268e0d243..59010c140 100644 --- a/httemplate/elements/select.html +++ b/httemplate/elements/select.html @@ -4,7 +4,12 @@ ID = "<% $opt{id} %>" previousValue = "<% $curr_value %>" previousText = "<% $labels->{$curr_value} || $curr_value %>" + <% $multiple %> + <% $size %> + <% $style %> + <% $opt{disabled} %> <% $onchange %> + <% $opt{'element_etc'} %> > % if ( $opt{options} ) { @@ -43,10 +48,6 @@ my %opt = @_; -my $onchange = $opt{'onchange'} - ? 'onChange="'. $opt{'onchange'}. '(this)"' - : ''; - my $labels = $opt{'option_labels'} || $opt{'labels'}; my $curr_value = $opt{'curr_value'}; @@ -60,4 +61,21 @@ if ( $opt{'onchange'} ) { $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' : ''; +