var valProvince = obj.options[obj.selectedIndex].value;
setDropDownList(ddlCarProvince, valProvince);
ddlCusDistrict.options.length = 0;
ddlCusSubDistrict.options.length = 0;
PageMethods.SetDistrictList(obj.options[obj.selectedIndex].value, securityCode, populateDistrictSuccess, function() { alert('Set District is fail'); });
}
}
function populateDistrictSuccess(result) {
var init = result;
ddlCusDistrict.options.length = 0;
if (result == null) return;
for (var i = 0; i < init.length; i++) ddlCusDistrict.options.add(new Option(init[i].TextField, init[i].i_district));
setSubdistrictList(ddlCusDistrict);
}
function populateSubdistrictSuccess(result) {
var init = result;
ddlCusSubDistrict.options.length = 0;
txtCustPostCodeJS.SetValue("");
if (result == null) return;
for (var i = 0; i < init.length; i++) ddlCusSubDistrict.options.add(new Option(init[i].TextField, init[i].SubdistrictCode));
txtCustPostCodeJS.SetValue(init[0].ZIPCODE);
}
function setSubdistrictList(obj) {
if (obj.selectedIndex == -1 || ddlCusProvince.selectedIndex == -1) return;