summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/select-state.html
blob: 64da36ba74216bf18c36aec4dcd6d19fa318d57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<%

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

%>

<SELECT NAME="<%= $opt{'prefix'} %>state" onChange="<%= $opt{'prefix'} %>state_changed(this); <%= $opt{'onchange'} %>" <%= $opt{'disabled'} %>>

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

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

<% } %>

</SELECT>