省市县的下拉列表

Posted guoyinglichong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了省市县的下拉列表相关的知识,希望对你有一定的参考价值。

首先在数据库里创建一张表cmf_citys,向这张表中导入数据,.sql文件

 

html中的代码

<li style="border:none">
  <if condition="$_GET[\'type\']==0 || $_GET[\'type\']==1 || $_GET[\'type\']==2 ||$_GET[\'type\']==4">
     省&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
     <select id="province" name="province" onchange="doProvAndCityRelation();" style="width:238px">
       <option id="choosePro" value="-1">请选择省份</option>
     </select><br>
  </if>
   <if condition="$_GET[\'type\']==0 || $_GET[\'type\']==1 ||$_GET[\'type\']==4">
     城&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
     <select id="citys" name="city" onchange="doCityAndCountyRelation();" style="width:238px">
        <option id=\'chooseCity\' value=\'-1\'>请选择城市</option>
     </select><br>
   </if>
   <if condition="$_GET[\'type\']==0||$_GET[\'type\']==4">
     区&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
     <select id="county" name="county" style="width:238px">
       <option id=\'chooseCounty\' value=\'-1\'>请选择区/县</option>
     </select>
   </if>
</li>

在jquery中的代码

<script src="__PUBLIC__/js/common.js?"></script>
<script src="__PUBLIC__/js/city.js?"></script>
<script type="text/javascript">
$("form").submit(function(){
        $("input[name=\'city\']").val("");
        $("input[name=\'prov\']").val("");
        var pro = $("#province").find("option:selected").val();
        var city = $("#citys").find("option:selected").val();
        var coun = $("#county").find("option:selected").val();
        if(coun!="-1"){
            $("input[name=\'city\']").val(coun);
        }else if(city !="-1"){
            $("input[name=\'prov\']").val(city);
        }else{
            $("input[name=\'prov\']").val(pro);
        }
    });
$(function(){
        $("#province").find("option[value=\'{$citys[0][\'province\']}\']").attr("selected","true");
        $("#province").change();
        $("#citys").find("option[value=\'{$citys[0][\'city\']}\']").attr("selected","true");
        $("#citys").change();
        $("#county").find("option[value=\'{$citys[0][\'county\']}\']").attr("selected","true");
        $("#county").change();  
});

  

php(tp控制器中)的代码

public function index()
{
header("content-type:text/html;charset=utf-8"); $user = $_SESSION[\'user\']; $users = D(\'q_users\'); $citys = D(\'citys\'); $where["user_login"] = $user; $yue = $users->where($where)->getField(\'coin\'); $this->assign(\'yue\',$yue); $gains = $users->where($where)->getField(\'gains\'); $this->assign(\'gains\',$gains); $result = $users ->where("user_login = \'$user\'") ->select(); if($result[0][\'province\'] !== null && $result[0][\'province\'] !== ""){ foreach($result as $key => $value) { $result[$key][\'protext\'] = $citys->where(\'id=\'.$value[\'province\'])->getField(\'text\'); if($value[\'city\'] !== null && $value[\'city\'] !== ""){ $result[$key][\'citytext\'] = $citys->where(\'id=\'.$value[\'city\'])->getField(\'text\'); if($value[\'county\'] !== null && $value[\'county\'] !== ""){ $result[$key][\'areatext\'] = $citys->where(\'id=\'.$value[\'county\'])->getField(\'text\'); } else { $result[$key][\'areatext\'] = ""; } } else { $result[$key][\'citytext\'] = ""; } } } $this->assign(\'users\',$result[0]); $this->assign(\'citys\',$result); $this->display(); }

 引入的city.js文件内容

var cityJson = [
    {"item_code":"110000","item_name":"北京市"},
]

$(function() {
  //load city.json
  var sb = new StringBuffer();
  $.each(cityJson,function(i, val) {
   if (val.item_code.substr(2, 4) == \'0000\') {
         sb.append("<option value=\'" + val.item_code + "\'>" + val.item_name + "</option>");
       }
     });
   $("#choosePro").after(sb.toString());
 
 }); // 省值变化时 处理市
 function doProvAndCityRelation() {
   var city = $("#citys");
   var county = $("#county");
   if (city.children().length > 1) {
     city.empty();
   }
   if (county.children().length > 1) {
     county.empty();
   }
   if ($("#chooseCity").length === 0) {
     city.append("<option id=\'chooseCity\' value=\'-1\'>请选择城市</option>");
   }
   if ($("#chooseCounty").length === 0) {
     county.append("<option id=\'chooseCounty\' value=\'-1\'>请选择区/县</option>");
   }
   var sb = new StringBuffer();
   $.each(cityJson,
     function(i, val) {
      if (val.item_code.substr(0, 2) == $("#province").val().substr(0, 2) && val.item_code.substr(2, 4) != \'0000\' && val.item_code.substr(4, 2) == \'00\') {
         sb.append("<option value=\'" + val.item_code + "\'>" + val.item_name + "</option>");
       }
     });
   $("#chooseCity").after(sb.toString());
 } // 市值变化时 处理区/县
 function doCityAndCountyRelation() {
   var cityVal = $("#citys").val();
   var county = $("#county");
   if (county.children().length > 1) {
     county.empty();
   }
   if ($("#chooseCounty").length === 0) {
     county.append("<option id=\'chooseCounty\' value=\'-1\'>请选择区/县</option>");
   }
   var sb = new StringBuffer();
   $.each(cityJson,
     function(i, val) {
       if (cityVal == \'110100\' || cityVal == "120100" || cityVal == "310100" || cityVal == "500100") {
         if (val.item_code.substr(0, 3) == cityVal.substr(0, 3) && val.item_code.substr(4, 2) != \'00\') {
           sb.append("<option value=\'" + val.item_code + "\'>" + val.item_name + "</option>");
         }
       } else {
         if (val.item_code.substr(0, 4) == cityVal.substr(0, 4) && val.item_code.substr(4, 2) != \'00\') {
           sb.append("<option value=\'" + val.item_code + "\'>" + val.item_name + "</option>");
         }
       }
     });
   $("#chooseCounty").after(sb.toString());
 
 }
 
 function StringBuffer(str) {
   var arr = [];
   str = str || "";
   var size = 0; // 存放数组大小
   arr.push(str);
  // 追加字符串
   this.append = function(str1) {
     arr.push(str1);
     return this;
   };
   // 返回字符串
   this.toString = function() {
     return arr.join("");
   };
  // 清空 
   this.clear = function(key) {
     size = 0;
     arr = [];
   };
   // 返回数组大小 
   this.size = function() {
     return size;
   };
   // 返回数组 
   this.toArray = function() {
     return buffer;
   };
   // 倒序返回字符串 
   this.doReverse = function() {
     var str = buffer.join(\'\');
     str = str.split(\'\');
     return str.reverse().join(\'\');
   };
 }
 
   1 var cityJson = [
   2 {"item_code":"110000","item_name":"北京市"},
   3 {"item_code":"120000","item_name":"天津市"},
   4 {"item_code":"130000","item_name":"河北省"},
   5 {"item_code":"140000","item_name":"山西省"},
   6 {"item_code":"150000","item_name":"内蒙古自治区"},
   7 {"item_code":"210000","item_name":"辽宁省"},
   8 {"item_code":"220000","item_name":"吉林省"},
   9 {"item_code":"230000","item_name":"黑龙江省"},
  10 {"item_code":"310000","item_name":"上海市"},
  11 {"item_code":"320000","item_name":"江苏省"},
  12 {"item_code":"330000","item_name":"浙江省"},
  13 {"item_code":"340000","item_name":"安徽省"},
  14 {"item_code":"350000","item_name":"福建省"},
  15 {"item_code":"360000","item_name":"江西省"},
  16 {"item_code":"370000","item_name":"山东省"},
  17 {"item_code":"410000","item_name":"河南省"},
  18 {"item_code":"420000","item_name":"湖北省"},
  19 {"item_code":"430000","item_name":"湖南省"},
  20 {"item_code":"440000","item_name":"广东省"},
  21 {"item_code":"450000","item_name":"广西壮族自治区"},
  22 {"item_code":"460000","item_name":"海南省"},
  23 {"item_code":"500000","item_name":"重庆市"},
  24 {"item_code":"510000","item_name":"四川省"},
  25 {"item_code":"520000","item_name":"贵州省"},
  26 {"item_code":"530000","item_name":"云南省"},
  27 {"item_code":"540000","item_name":"西藏自治区"},
  28 {"item_code":"610000","item_name":"陕西省"},
  29 {"item_code":"620000","item_name":"甘肃省"},
  30 {"item_code":"630000","item_name":"青海省"},
  31 {"item_code":"640000","item_name":"宁夏回族自治区"},
  32 {"item_code":"650000","item_name":"新疆维吾尔自治区"},
  33 
  34     
  35 {"item_code":"110100","item_name":"北京市"},
  36 {"item_code":"120100","item_name":"天津市"},
  37 {"item_code":"130100","item_name":"石家庄市"},
  38 {"item_code":"130200","item_name":"唐山市"},
  39 {"item_code":"130300","item_name":"秦皇岛市"},
  40 {"item_code":"130400","item_name":"邯郸市"},
  41 {"item_code":"130500","item_name":"邢台市"},
  42 {"item_code":"130600","item_name":"保定市"},
  43 {"item_code":"130700","item_name":"张家口市"},
  44 {"item_code":"130800","item_name":"承德市"},
  45 {"item_code":"130900","item_name":"沧州市"},
  46 {"item_code":"131000","item_name":"廊坊市"},
  47 {"item_code":"131100","item_name":"衡水市"},
  48 {"item_code":"140100","item_name":"太原市"},
  49 {"item_code":"140200","item_name":"大同市"},
  50 {"item_code":"140300","item_name":"阳泉市"},
  51 {"item_code":"140400","item_name":"长治市"},
  52 {"item_code":"140500","item_name":"晋城市"},
  53 {"item_code":"140600","item_name":"朔州市"},
  54 {"item_code":"140700","item_name":"晋中市"},
  55 {"item_code":"140800","item_name":"运城市"},
  56 {"item_code":"140900","item_name":"忻州市"},
  57 {"item_code":"141000","item_name":"临汾市"},
  58 {"item_code":"141100","item_name":"吕梁市"},
  59 {"item_code":"150100","item_name":"呼和浩特市"},
  60 {"item_code":"150200","item_name":"包头市"},
  61 {"item_code":"150300","item_name":"乌海市"},
  62 {"item_code":"150400","item_name":"赤峰市"},
  63 {"item_code":"150500","item_name":"通辽市"},
  64 {"item_code":"150600","item_name":"鄂尔多斯市"},
  65 {"item_code":"150700","item_name":"呼伦贝尔市"},
  66 {"item_code":"150800","item_name":"巴彦淖尔市"},
  67 {"item_code":"150900","item_name":"乌兰察布市"},
  68 {"item_code":"152200","item_name":"兴安盟"},
  69 {"item_code":"152500","item_name":"锡林郭勒盟"},
  70 {"item_code":"152900","item_name":"阿拉善盟"},
  71 {"item_code":"210100","item_name":"沈阳市"},
  72 {"item_code":"210200","item_name":"大连市"},
  73 {"item_code":"210300","item_name":"鞍山市"},
  74 {"item_code":"210400","item_name":"抚顺市"},
  75 {"item_code":"210500","item_name":"本溪市"},
  76 {"item_code":"210600","item_name":"丹东市"},
  77 {"item_code":"210700","item_name":"锦州市"},
  78 {"item_code":"210800","item_name":"营口市"},
  79 {"item_code":"210900","item_name":"阜新市"},
  80 {"item_code":"211000","item_name":"辽阳市"},
  81 {"item_code":"211100","item_name":"盘锦市"},
  82 {"item_code":"211200","item_name":"铁岭市"},
  83 {"item_code":"211300","item_name":"朝阳市"},
  84 {"item_code":"211400","item_name":"葫芦岛市"},
  85 {"item_code":"220100","item_name":"长春市"},
  86 {"item_code":"220200","item_name":"吉林市"},
  87 {"item_code":"220300","item_name":"四平市"},
  88 {"item_code":"220400","item_name":"辽源市"},
  89 {"item_code":"220500","item_name":"通化市"},
  90 {"item_code":"220600","item_name":"白山市"},
  91 {"item_code":"220700","item_name":"松原市"},
  92 {"item_code":"220800","item_name":"白城市"},
  93 {"item_code":"222400","item_name":"延边朝鲜族自治州"},
  94 {"item_code":"230100","item_name":"哈尔滨市"},
  95 {"item_code":"230200","item_name":"齐齐哈尔市"},
  96 {"item_code":"230300","item_name":"鸡西市"},
  97 {"item_code":"230400","item_name":"鹤岗市"},
  98 {"item_code":"230500","item_name":"双鸭山市"},
  99 {"item_code":"230600","item_name":"大庆市"},
 100 {"item_code":"230700","item_name":"伊春市"},
 101 {"item_code":"230800","item_name":"佳木斯市"},
 102 {"item_code":"230900","item_name":"七台河市"},
 103 {"item_code":"231000","item_name":"牡丹江市"},
 104 {"item_code":"231100","item_name":"黑河市"},
 105 {"item_code":"231200","item_name":"绥化市"},
 106 {"item_code":"232700","item_name":"大兴安岭地区"},
 107 {"item_code":"310100","item_name":"上海市"},
 108 {"item_code":"320100","item_name":"南京市"},
 109 {"item_code":"320200","item_name":"无锡市"},
 110 {"item_code":"320300","item_name":"徐州市"},
 111 {"item_code":"320400","item_name":"常州市"},
 112 {"item_code":"320500","item_name":"苏州市"},
 113 {"item_code":"320600","item_name":"南通市"},
 114 {"item_code":"320700","item_name":"连云港市"},
 115 {"item_code":"320800","item_name":"淮安市"},
 116 {"item_code":"320900","item_name":"盐城市"},
 117 {"item_code":"321000","item_name":"扬州市"},
 118 {"item_code":"321100","item_name":"镇江市"},
 119 {"item_code":"321200","item_name":"泰州市"},
 120 {"item_code":"321300","item_name":"宿迁市"},
 121 {"item_code":"330100","item_name":"杭州市"},
 122 {"item_code":"330200","item_name":"宁波市"},
 123 {"item_code":"330300","item_name":"温州市"},
 124 {"item_code":"330400","item_name":"嘉兴市"},
 125 {"item_code":"330500","item_name":"湖州市"},
 126 {"item_code":"330600","item_name":"绍兴市"},
 127 {"item_code":"330700","item_name":"金华市"},
 128 {"item_code":"330800","item_name":"衢州市"},
 129 {"item_code":"330900","item_name":"舟山市"},
 130 {"item_code":"331000","item_name":"台州市"},
 131 {"item_code":"331100","item_name":"丽水市"},
 132 {"item_code":"340100","item_name":"合肥市"},
 133 {"item_code":"340200","item_name":"芜湖市"},
 134 {"item_code":"340300","item_name":"蚌埠市"},
 135 {"item_code":"340400","item_name":"淮南市"},
 136 {"item_code":"340500","item_name":"马鞍山市"},
 137 {"item_code":"340600","item_name":"淮北市"},
 138 {"item_code":"340700","item_name":"铜陵市"},
 139 {"item_code":"340800","item_name":"安庆市"},
 140 {"item_code":"341000","item_name":"黄山市"},
 141 {"item_code":"341100","item_name":"滁州市"},
 142 {"item_code":"341200","item_name":"阜阳市"},
 143 {"item_code":"341300","item_name":"宿州市"},
 144 {"item_code":"341500","item_name":"六安市"},
 145 {"item_code":"341600","item_name":"亳州市"},
 146 {"item_code":"341700","item_name":"池州市"},
 147 {"item_code":"341800","item_name":"宣城市"},
 148 {"item_code":"350100","item_name":"福州市"},
 149 {"item_code":"350200","item_name":"厦门市"},
 150 {"item_code":"350300","item_name":"莆田市"},
 151 {"item_code":"350400","item_name":"三明市"},
 152 {"item_code":"350500","item_name":"泉州市"},
 153 {"item_code":"350600","item_name":"漳州市"},
 154 {"item_code":"350700","item_name":"南平市"},
 155 {"item_code":"350800","item_name":"龙岩市"},
 156 {"item_code":"350900","item_name":"宁德市"},
 157 {"item_code":"360100","item_name":"南昌市"},
 158 {"item_code":"360200","item_name":"景德镇市"},
 159 {"item_code":"360300","item_name":"萍乡市"},
 160 {"item_code":"360400","item_name":"九江市"},
 161 {"item_code":"360500","item_name":"新余市"},
 162 {"item_code":"360600","item_name":"鹰潭市"},
 163 {"item_code":"360700","item_name":"赣州市"},
 164 {"item_code":"360800","item_name":"吉安市"},
 165 {"item_code":"360900","item_name":"宜春市"},
 166 {"item_code":"361000","item_name":"抚州市"},
 167 {"item_code":"361100","item_name":"上饶市"},
 168 {"item_code":"370100","item_name":"济南市"},
 169 {"item_code":"370200","item_name":"青岛市"},
 170 {"item_code":"370300","item_name":"淄博市"},
 171 {"item_code":"370400","item_name":"枣庄市"},
 172 {"item_code":"370500","item_name":"东营市"},
 173 {"item_code":"370600","item_name":"烟台市"},
 174 {"item_code":"370700","item_name":"潍坊市"},
 175 {"item_code":"370800","item_name":"济宁市"},
 176 {"item_code":"370900","item_name":"泰安市"},
 177 {"item_code":"371000","item_name":"威海市"},
 178 {"item_code":"371100","item_name":"日照市"},
 179 {"item_code":"371200","item_name":"莱芜市"},
 180 {"item_code":"371300","item_name":"临沂市"},
 181 {"item_code":"371400","item_name":"德州市"},
 182 {"item_code":"371500","item_name":"聊城市"},
 183 {"item_code":"371600","item_name":"滨州市"},
 184 {"item_code":"371700","item_name":"菏泽市"},
 185 {"item_code":"410100","item_name":"郑州市"},
 186 {"item_code":"410200","item_name":"开封市"},
 187 {"item_code":"410300","item_name":"洛阳市"},
 188 {"item_code":"410400","item_name":"平顶山市"},
 189 {"item_code":"410500","item_name":"安阳市"},
 190 {"item_code":"410600","item_name":"鹤壁市"},
 191 {"item_code":"410700","item_name":"新乡市"},
 192 {"item_code":"410800","item_name":"焦作市"},
 193 {"item_code":"410900","item_name":"濮阳市"},
 194 {"item_code":"411000","item_name":"许昌市"},
 195 {"item_code":"411100","item_name":"漯河市"},
 196 {"item_code":"411200","item_name":"三门峡市"},
 197 {"item_code":"411300","item_name":"南阳市"},
 198 {"item_code":"411400","item_name":"商丘市"},
 199 {"item_code":"411500","item_name":"信阳市"},
 200 {"item_code":"411600","item_name":"周口市"},
 201 {"item_code":"411700","item_name":"驻马店市"},
 202 {"item_code":"420100","item_name":"武汉市"},
 203 {"item_code":"420200","item_name":"黄石市"},
 204 {"item_code":"420300","item_name":"十堰市"},
 205 {"item_code":"420500","item_name":"宜昌市"},
 206 {"item_code":"420600","item_name":"襄樊市"},
 207 {"item_code":"420700","item_name":"鄂州市"},
 208 {"item_code":"420800","item_name":"荆门市"},
 209 {"item_code":"420900","item_name":"孝感市"},
 210 {"item_code":"421000","item_name":"荆州市"},
 211 {"item_code":"421100","item_name":"黄冈市"},
 212 {"item_code":"421200","item_name":"咸宁市"},
 213 {"item_code":"421300","item_name":"随州市"},
 214 {"item_code":"422800","item_name":"恩施土家族苗族自治州"},
 215 {"item_code":"430100","item_name":"长沙市"},
 216 {"item_code":"430200","item_name":"株洲市"},
 217 {"item_code":"430300","item_name":"湘潭市"},
 218 {"item_code":"430400","item_name":"衡阳市"},
 219 {"item_code":"430500","item_name":"邵阳市"},
 220 {"item_code":"430600","item_name":"岳阳市"},
 221 {"item_code":"430700","item_name":"常德市"},
 222 {"item_code":"430800","item_name":"张家界市"},
 223 {"item_code":"430900","item_name":"益阳市"},
 224 {"item_code":"431000","item_name":"郴州市"},
 225 {"item_code":"431100","item_name":"永州市"},
 226 {"item_code":"431200","item_name":"怀化市"},
 227 {"item_code":"431300","item_name":"娄底市"},
 228 {"item_code":"433100","item_name":"湘西土家族苗族自治州"},
 229 {"item_code":"440100","item_name":"广州市"},
 230 {"item_code":"440200","item_name":"韶关市"},
 231 {"item_code":"440300","item_name":"深圳市"},
 232 {"item_code":"440400","item_name":"珠海市"},
 233 {"item_code":"440500","item_name":"汕头市"},
 234 {"item_code":"440600","item_name":"佛山市"},
 235 {"item_code":"440700","item_name":"江门市"},
 236 {"item_code":"440800","item_name":"湛江市"},
 237 {"item_code":"440900","item_name":"茂名市"},
 238 {"item_code":"441200","item_name":"肇庆市"},
 239 {"item_code":"441300","item_name":"惠州市"},
 240 {"item_code":"441400","item_name":"梅州市"},
 241 {"item_code":"441500","item_name":"汕尾市"},
 242 {"item_code":"441600","item_name":"河源市"},
 243 {"item_code":"441700","item_name":"阳江市"},
 244 {"item_code":"441800","item_name":"清远市"},
 245 {"item_code":"441900","item_name":"东莞市"},
 246 {"item_code":"442000","item_name":"中山市"},
 247 {"item_code":"445100","item_name":"潮州市"},
 248 {"item_code":"445200","item_name":"揭阳市"},
 249 {"item_code":"445300","item_name":"云浮市"},
 250 {"item_code":"450100","item_name":"南宁市"},
 251 {"item_code":"450200","item_name":"柳州市"},
 252 {"item_code":"450300","item_name":"桂林市"},
 253 {"item_code":"450400","item_name":"梧州市"},
 254 {"item_code":"450500","item_name":"北海市"},
 255 {"item_code":"450600","item_name":"防城港市"},
 256 {"item_code":"450700","item_name":"钦州市"},
 257 {"item_code":"450800","item_name":"贵港市"},
 258 {"item_code":"450900","item_name":"玉林市"},
 259 {"item_code":"451000","item_name":"百色市"},
 260 {"item_code":"451100","item_name":"贺州市"},
 261 {"item_code":"451200","item_name":"河池市"},
 262 {"item_code":"451300","item_name":"来宾市"},
 263 {"item_code":"451400","item_name":"崇左市"},
 264 {"item_code":"460100","item_name":"海口市"},
 265 {"item_code":"460200","item_name":"三亚市"},
 266 {"item_code":"500100","item_name":"重庆市"},
 267 {"item_code":"510100","item_name":"成都市"},
 268 {"item_code":"510300","item_name":"自贡市"},
 269 {"item_code":"510400","item_name":"攀枝花市"},
 270 {"item_code":"510500","item_name":"泸州市"},
 271 {"item_code":"510600","item_name":"德阳市"},
 272 {"item_code":"510700","item_name":"绵阳市"},
 273 {"item_code":"510800","item_name":"广元市"},
 274 {"item_code":"510900","item_name":"遂宁市"},
 275 {"item_code":"511000","item_name":"内江市"},
 276 {"item_code":"511100","item_name":"乐山市"},
 277 {"item_code":"511300","item_name":"南充市"},
 278 {"item_code":"511400","item_name":"眉山市"},
 279 {"item_code":"511500","item_name":"宜宾市"},
 280 {"item_code":"511600","item_name":"广安市"},
 281 {"item_code":"511700","item_name":"达州市"},
 282 {"item_code":"511800","item_name":"雅安市"},
 283 {"item_code":"511900","item_name":"巴中市"},
 284 {"item_code":"512000","item_name":"资阳市"},
 285 {"item_code":"513200","item_name":"阿坝藏族羌族自治州"},
 286 {"item_code":"513300","item_name":"甘孜藏族自治州"},
 287 {"item_code":"513400","item_name":"凉山彝族自治州"},
 288 {"item_code":"520100","item_name":"贵阳市"},
 289 {"item_code":"520200","item_name":"六盘水市"},
 290 {"item_code":"520300","item_name":"遵义市"},
 291 {"item_code":"520400","item_name":"安顺市"},
 292 {"item_code":"520500","item_name":"毕节市"},
 293 {"item_code":"520601","item_name":"铜仁市"},
 294 {"item_code":"522300","item_name":"黔西南布依族苗族自治州"},
 295 {"item_code":"522600","item_name":"黔东南苗族侗族自治州"},
 296 {"item_code":"522700","item_name":"黔南布依族苗族自治州"},
 297 {"item_code":"530100","item_name":"昆明市"},
 298 {"item_code":"530300","item_name":"曲靖市"},
 299 {"item_code":"530400","item_name":"玉溪市"},
 300 {"item_code":"530500","item_name":"保山市"},
 301 {"item_code":"530600","item_name":"昭通市"},
 302 {"item_code":"530700","item_name":"丽江市"},
 303 {"item_code":"530800","item_name":"普洱市"},
 304 {"item_code":"530900","item_name":"临沧市"},
 305 {"item_code":"532300","item_name":"楚雄彝族自治州"},
 306 {"item_code":"532500","item_name":"红河哈尼族彝族自治州"},
 307 {"item_code":"532600","item_name":"文山壮族苗族自治州"},
 308 {"item_code":"532800","item_name":"西双版纳傣族自治州"},
 309 {"item_code":"532900","item_name":"大理白族自治州"},
 310 {"item_code":"533100","item_name":"德宏傣族景颇族自治州"},
 311 {"item_code":"533300","item_name":"怒江傈僳族自治州"},
 312 {"item_code":"533400","item_name":"迪庆藏族自治州"},
 313 {"item_code":"540100","item_name":"拉萨市"},
 314 {"item_code":"542100","item_name":"昌都地区"},
 315 {"item_code":"542200","item_name":"山南地区"},
 316 {"item_code":"542300","item_name":"日喀则地区"},
 317 {"item_code":"542400","item_name":"那曲地区"},
 318<

以上是关于省市县的下拉列表的主要内容,如果未能解决你的问题,请参考以下文章

vue+element省市县的二级联动功能

c# 做省市县联动

中国各个省市县的人口统计,echart展示

Spinner实现省市县的三级联动

JS设计省市县的联动

c# 求WPF省市区三级联动代码,是从xml中得到省市区数据后添加到三个下拉列表。