Will things ever be the same again?
[freeside.git] / httemplate / edit / cust_main / select-state.html
1 %
2 %
3 %  my %opt = @_;
4 %  foreach my $opt (qw( county state country prefix onchange disabled )) {
5 %    $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
6 %  }
7 %
8 %
9
10
11 <SELECT NAME="<% $opt{'prefix'} %>state" onChange="<% $opt{'prefix'} %>state_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
12 % tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} ); 
13 % foreach my $state ( keys %states ) { 
14
15
16   <OPTION VALUE="<% $state %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>
17 % } 
18
19
20 </SELECT>
21