Fix: change the content of states select if country is different

This commit is contained in:
Regis Houssin 2010-10-13 16:49:43 +00:00
parent aa7eca2b87
commit 884e5eca1f
2 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$row_array['selectpays_id'] = $row['fk_country'];
$row_array['departement_id'] = $row['fk_county'];
$row_array['countydata'] = $formcompany->select_state('',$row['fk_country'],'');
$row_array['states'] = $formcompany->select_state('',$row['fk_country'],'');
array_push($return_arr,$row_array);
}

View File

@ -161,7 +161,7 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='')
response( jQuery.map( data, function( item ) {
if (data.length == 1) {
jQuery("#'.$htmlname.'").val(item.value);
if (item.countydata) {
if (item.states) {
jQuery("#departement_id").html(item.states);
}
for (i=0;i<length;i++) {
@ -175,7 +175,7 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='')
});
},
select: function( event, ui ) {
if (ui.item.countydata) {
if (ui.item.states) {
jQuery("#departement_id").html(ui.item.states);
}
for (i=0;i<length;i++) {