deal with counties with spaces, etc., RT#4496
authorivan <ivan>
Sun, 28 Dec 2008 18:59:49 +0000 (18:59 +0000)
committerivan <ivan>
Sun, 28 Dec 2008 18:59:49 +0000 (18:59 +0000)
httemplate/browse/cust_main_county.cgi

index 256c51d..34f1000 100755 (executable)
@@ -175,9 +175,9 @@ $cgi->param('dummy', 1);
 
 my $filter_change =
   "window.location = '". $cgi->self_url.
-  ";country=' + document.getElementById('country').options[document.getElementById('country').selectedIndex].value + ".
-  "';state='   + document.getElementById('state').options[document.getElementById('state').selectedIndex].value +".
-  "';county='  + document.getElementById('county').options[document.getElementById('county').selectedIndex].value;";
+  ";country=' + encodeURIComponent( document.getElementById('country').options[document.getElementById('country').selectedIndex].value ) + ".
+  "';state='   + encodeURIComponent( document.getElementById('state').options[document.getElementById('state').selectedIndex].value ) +".
+  "';county='  + encodeURIComponent( document.getElementById('county').options[document.getElementById('county').selectedIndex].value );";
 
 #restore this so pagination works
 $cgi->param('country',  $country) if $country;