summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/select-state.html
blob: 4f1c056b51f8fa043d1202cecc28cf1c8b9f0591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<SELECT NAME="<% $opt{'prefix'} %>state" onChange="<% $opt{'prefix'} %>state_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>

% if ($opt{empty}) {
  <OPTION VALUE=""<% $opt{state} eq '' ? ' SELECTED' : '' %>><% $opt{empty} %>
% }

% foreach my $state ( keys %states ) { 

  <OPTION VALUE="<% $state %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>

% } 


</SELECT>

<%init>
my %opt = @_;
foreach my $opt (qw( county state country prefix onchange disabled empty )) {
  $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
}

tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} ); 
</%init>