From 9e342300c380e29af1b9678f1a9604609e0061b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 10 Sep 2005 14:50:57 +0000 Subject: ajax-style xmlhttprequest state/county/country selector! --- httemplate/misc/states.cgi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 httemplate/misc/states.cgi (limited to 'httemplate/misc/states.cgi') diff --git a/httemplate/misc/states.cgi b/httemplate/misc/states.cgi new file mode 100644 index 000000000..cff2c9774 --- /dev/null +++ b/httemplate/misc/states.cgi @@ -0,0 +1,16 @@ +<% + + my $country = $cgi->param('arg'); + + my @states = + sort + map { s/[\n\r]//g; $_; } + map { $_->state; } + qsearch( 'cust_main_county', + { 'country' => $country }, + 'DISTINCT ON ( state ) *', + ) + ; + + +%>[ <%= join(', ', map { qq("$_") } @states) %> ] -- cgit v1.2.1