X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect.html;h=59010c140c0e0c01e92732dfcedb47a74b4eae3b;hb=58dca90a87df3a8de108c3f92f6f3017da734d96;hp=7aa4180b6d651639c136a980992b2a3688f3ed28;hpb=6874a21f3cb26a167e49cc1324df30119c6ed75d;p=freeside.git diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index 7aa4180b6..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} ) { @@ -42,11 +47,6 @@ <%init> my %opt = @_; -warn "SELECT.HTML: ". join ' / ', %opt; - -my $onchange = $opt{'onchange'} - ? 'onChange="'. $opt{'onchange'}. '(this)"' - : ''; my $labels = $opt{'option_labels'} || $opt{'labels'}; @@ -61,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' : ''; +