diff options
| author | ivan <ivan> | 2005-09-10 14:50:57 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2005-09-10 14:50:57 +0000 |
| commit | 9e342300c380e29af1b9678f1a9604609e0061b6 (patch) | |
| tree | 72d0edb8de70b19465264c76669045b0ba202e6e /httemplate/edit/cust_main/select-state.html | |
| parent | 3502e0627909ea99683d1724adb0d4a3fee578b2 (diff) | |
ajax-style xmlhttprequest state/county/country selector!
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> + |
