eliminate funkiness with reappearing "Postal invoice" on errors
[freeside.git] / httemplate / edit / cust_main / select-state.html
index 64da36b..87546e5 100644 (file)
@@ -1,20 +1,20 @@
-<%
+<SELECT NAME="<% $opt{'prefix'} %>state" onChange="<% $opt{'prefix'} %>state_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
 
-  my %opt = @_;
-  foreach my $opt (qw( county state country prefix onchange disabled )) {
-    $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
-  }
+% foreach my $state ( keys %states ) { 
 
-%>
+  <OPTION VALUE="<% $state %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>
 
-<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>
 
-<% } %>
+<%init>
+my %opt = @_;
+foreach my $opt (qw( county state country prefix onchange disabled )) {
+  $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
+}
 
-</SELECT>
+tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} ); 
+</%init>