diff options
Diffstat (limited to 'httemplate/edit/cust_main/select-state.html')
-rw-r--r-- | httemplate/edit/cust_main/select-state.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/httemplate/edit/cust_main/select-state.html b/httemplate/edit/cust_main/select-state.html new file mode 100644 index 000000000..98e685ab8 --- /dev/null +++ b/httemplate/edit/cust_main/select-state.html @@ -0,0 +1,27 @@ +<% + + 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'} %>> + +<% foreach my $state ( + sort + map { $_->state } + qsearch( 'cust_main_county', + { 'country' => $opt{'country'} }, + 'DISTINCT ON ( state ) *', + ) + ) { +%> + + <OPTION VALUE="<%= $state %>"<%= $state eq $opt{'state'} ? ' SELECTED' : '' %>><%= $state || '(n/a)' %> + +<% } %> + +</SELECT> + |