disable_empty => 1, #defaults to 1, disable the empty option
empty_label => 'all', #label for empty option
disable_countyupdate => 0, #bool - disabled update of the select-state.html
+ style => [ 'attribute:value', 'another:value' ],
);
</%doc>
<SELECT NAME = "<% $pre %>state"
ID = "<% $pre %>state"
onChange = "<% $onchange %>"
+ <% $opt{'disabled'} %>
+ <% $style %>
>
% unless ( $opt{'disable_empty'} ) {
% foreach my $state ( keys %states ) {
- <OPTION VALUE="<% $state |h %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>
+ <OPTION VALUE="<% $state |h %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' |h %>
% }
( $opt{'disable_countyupdate'} ? '' : $pre.'state_changed(this); ' ).
$opt{'onchange'};
+$opt{'style'} ||= [];
+my $style =
+ scalar(@{$opt{style}})
+ ? 'STYLE="'. join(';', @{$opt{style}}). '"'
+ : '';
+
tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} );
</%init>