var regiondb = new Object() var citylist = new Object() regiondb["a"] = [{value:"0", text:"Chọn Quận/Huyện"}];regiondb[21] = [{value:"0", text:"Chọn Quận/Huyện"},{value:"63", text:"Q.Ba Đình"},{value:"65", text:"Q.Cầu Giấy"},{value:"73", text:"Q.Từ Liêm"},{value:"64", text:"Q.Đống Đa"},{value:"67", text:"Q.Hai Bà Trưng"},{value:"66", text:"Q.Hoàn Kiếm"},{value:"68", text:"Q.Hoàng Mai"},{value:"69", text:"Q.Long Biên"},{value:"70", text:"Q.Tây Hồ"},{value:"1504", text:"Q.Hà Đông"},{value:"71", text:"Q.Thanh Xuân"},{value:"175", text:"H.Thanh Trì"},{value:"1489", text:"TX. Sơn Tây"},{value:"74", text:"H.Sóc Sơn"},{value:"176", text:"H.Gia Lâm"},{value:"1503", text:"H.Đan Phượng"},{value:"1490", text:"H.Ba Vì"},{value:"1492", text:"H.Chương Mỹ"},{value:"1502", text:"H.Hoài Đức"},{value:"1493", text:"H.Mê Linh"},{value:"1494", text:"H.Mỹ Đức"},{value:"1495", text:"H.Phú Xuyên"},{value:"1496", text:"H.Phúc Thọ"},{value:"1497", text:"H.Quốc Oai"},{value:"1498", text:"H.Thạch Thất"},{value:"1499", text:"H.Thanh Oai"},{value:"1500", text:"H.Thường Tín"},{value:"1501", text:"H.Ứng Hòa"},{value:"177", text:"H.Đông Anh"}];regiondb[55] = [{value:"0", text:"Chọn Quận/Huyện"},{value:"95", text:"Bình Chánh"},{value:"92", text:"Bình Tân"},{value:"89", text:"Bình Thạnh"},{value:"97", text:"Cần Giờ"},{value:"93", text:"Củ Chi"},{value:"87", text:"Gò Vấp"},{value:"94", text:"Hóc môn"},{value:"96", text:"Nhà Bè"},{value:"133", text:"Phú Nhuận"},{value:"75", text:"Quận 1"},{value:"84", text:"Quận 10"},{value:"85", text:"Quận 11"},{value:"86", text:"Quận 12"},{value:"76", text:"Quận 2"},{value:"77", text:"Quận 3"},{value:"78", text:"Quận 4"},{value:"79", text:"Quận 5"},{value:"80", text:"Quận 6"},{value:"81", text:"Quận 7"},{value:"82", text:"Quận 8"},{value:"83", text:"Quận 9"},{value:"88", text:"Tân Bình"},{value:"90", text:"Tân Phú"},{value:"91", text:"Thủ Đức"}];citylist[0] = [{value:"a", text:"Chọn tỉnh/TP"},{value:"21", text:"Hà Nội"},{value:"55", text:"Tp Hồ Chí Minh"}]; function setCities(thanpho,quan,valuequan) { var newElem; var chooser = document.getElementById(thanpho); var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var cityChooser = document.getElementById(quan); while (cityChooser.options.length) { cityChooser.remove(0); } var choice = chooser.options[chooser.selectedIndex].value; var db = regiondb[choice]; if(choice === "") choice = 0; if (choice != "") { if(choice == "a"){ cityChooser.disabled = true; }else{ cityChooser.disabled = false; } //alert(choice); for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cityChooser.add(newElem, where); if(valuequan == db[i].value) cityChooser.options[i].selected = true; } } } function setListCombo(thanpho,valuetp){ var newElem; var cityId = document.getElementById(thanpho); var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null; var db = citylist[0]; while (cityId.options.length) { cityId.remove(0); } for (var i = 0; i < db.length; i++) { newElem = document.createElement("option"); newElem.text = db[i].text; newElem.value = db[i].value; cityId.add(newElem, where); if(valuetp == db[i].value) cityId.options[i].selected = true; } }