combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / city.html
index 1659ebf..956d353 100644 (file)
@@ -34,7 +34,7 @@ Example:
     what.options[length] = optionName;
   }
 
-  var saved_<%$pre%>city= '';
+  var saved_<%$pre%>city= '<% $saved_city |h %>';
 
   function <% $pre %>county_changed(what, callback) {
 
@@ -61,9 +61,10 @@ Example:
      if ( citiesArray.length > 1 || citiesArray[0].length ) { 
         // turn off the text city, turn on the select
         saved_<%$pre%>city = what.form.<%$ pre %>city.value;
+        <%$pre%>city_select_changed(what.form.<% $pre %>city_select);
         what.form.<% $pre %>city.style.display = 'none';
         what.form.<% $pre %>city_select.style.display = '';
-      } else {
+      } else if ( what.form.<% $pre %>city.style.display == 'none' ) {
         // turn on the text city, turn off the select
         what.form.<%$ pre %>city.value = saved_<%$pre%>city;
         what.form.<% $pre %>city.style.display = '';
@@ -123,10 +124,12 @@ my $text_style   = $opt{'style'} ? [ @{ $opt{'style'} } ] : [];
 my $select_style = $opt{'style'} ? [ @{ $opt{'style'} } ] : [];
 
 my @cities = cities( $opt{'county'}, $opt{'state'}, $opt{'country'} );
+my $saved_city = '';
 if ( scalar(@cities) > 1 || $cities[0] ) {
   push @$text_style, 'display:none';
 } else {
   push @$select_style, 'display:none';
+  $saved_city = $opt{'city'};
 }
 
 $text_style =