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/edit/cust_main.cgi | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/cust_main.cgi') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index a8f202fbb..d10b21a4a 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -173,11 +173,17 @@ function bill_changed(what) { <% for (qw( last first company address1 address2 city zip daytime night fax )) { %> what.form.ship_<%=$_%>.value = what.form.<%=$_%>.value; <% } %> + what.form.ship_country.selectedIndex = what.form.country.selectedIndex; - ship_country_changed(what.form.ship_country); - what.form.ship_state.selectedIndex = what.form.state.selectedIndex; - ship_state_changed(what.form.ship_state); - what.form.ship_county.selectedIndex = what.form.county.selectedIndex; + function fix_ship_state() { + what.form.ship_state.selectedIndex = what.form.state.selectedIndex; + } + ship_country_changed(what.form.ship_country, fix_ship_state ); + + function fix_ship_county() { + what.form.ship_county.selectedIndex = what.form.county.selectedIndex; + } + ship_state_changed(what.form.ship_state, fix_ship_county ); } } function samechanged(what) { -- cgit v1.2.1