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 8df60625a5
commit aa7eca2b87

View File

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