what.options[length] = optionName;
}
- var saved_<%$pre%>city= '';
+ var saved_<%$pre%>city= '<% $saved_city |h %>';
function <% $pre %>county_changed(what, callback) {
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 = '';
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 =