X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect.html;h=5249a6dc3e43d33d7521af7d0e3f4f63a12a2106;hb=ace15413d2fe16ac9eeac3e7e292025b60d40d22;hp=7aa4180b6d651639c136a980992b2a3688f3ed28;hpb=6874a21f3cb26a167e49cc1324df30119c6ed75d;p=freeside.git diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index 7aa4180b6..5249a6dc3 100644 --- a/httemplate/elements/select.html +++ b/httemplate/elements/select.html @@ -4,6 +4,8 @@ ID = "<% $opt{id} %>" previousValue = "<% $curr_value %>" previousText = "<% $labels->{$curr_value} || $curr_value %>" + <% $style %> + <% $opt{disabled} %> <% $onchange %> > @@ -42,7 +44,6 @@ <%init> my %opt = @_; -warn "SELECT.HTML: ". join ' / ', %opt; my $onchange = $opt{'onchange'} ? 'onChange="'. $opt{'onchange'}. '(this)"' @@ -61,4 +62,18 @@ 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). '"' : ''; + +