summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/select-state.html
diff options
context:
space:
mode:
authorivan <ivan>2006-08-25 19:30:52 +0000
committerivan <ivan>2006-08-25 19:30:52 +0000
commit7517eaa583bcb213b62dfd0c11288aa50a350e8a (patch)
treea1a123dfb5a048348775e237f64ea25f6417bf2f /httemplate/edit/cust_main/select-state.html
parentb19266599870172bda0921df60020f0440854750 (diff)
use GROUP BY instead of DISTINCT ON in the state and country queries for better cross-database compatibility, based on a preliminary patch from Jason Thomas
Diffstat (limited to 'httemplate/edit/cust_main/select-state.html')
-rw-r--r--httemplate/edit/cust_main/select-state.html23
1 files changed, 11 insertions, 12 deletions
diff --git a/httemplate/edit/cust_main/select-state.html b/httemplate/edit/cust_main/select-state.html
index a7e56e78f..87546e5e3 100644
--- a/httemplate/edit/cust_main/select-state.html
+++ b/httemplate/edit/cust_main/select-state.html
@@ -1,21 +1,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 ) {
+% 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{$_});
+}
+
+tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} );
+</%init>
+