X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcity.html;h=956d353bd5a6b237434afc9a701f227be6f3af19;hb=b431ece7b4a71aa5771f44393da582692f668817;hp=47e5c37c2e30737156207571d148100a740a8d01;hpb=11e7e902c43e46585ccf43e67b11ed040f6655f7;p=freeside.git diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html index 47e5c37c2..956d353bd 100644 --- a/httemplate/elements/city.html +++ b/httemplate/elements/city.html @@ -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) { @@ -64,7 +64,7 @@ Example: <%$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 = ''; @@ -124,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 =