Js级联

转载 2007年10月05日 11:34:00

<form name="form001" method="post" action="">
<script src="province.js"></script>
             
         <select onChange=ProvinceChange(this,form001.city_front); name=province_front>
                <option value="0" selected>=省份=</option>
                <option value="上海">上海</option>
                <option value="江苏">江苏</option>
                <option value="广东">广东</option>
                <option value="浙江">浙江</option>
                <option value="福建">福建</option>
                <option value="湖北">湖北</option>
                <option value="湖南">湖南</option>
                <option value="北京">北京</option>
                <option value="天津">天津</option>
                <option value="香港">香港</option>
                <option value="澳门">澳门</option>
                <option value="台湾">台湾</option>
                <option value="江西">江西</option>
                <option value="山东">山东</option>
                <option value="山西">山西</option>
                <option value="河南">河南</option>
                <option value="河北">河北</option>
                <option value="四川">四川</option>
                <option value="重庆">重庆</option>
                <option value="安徽">安徽</option>
                <option value="广西">广西</option>
                <option value="云南">云南</option>
                <option value="海南">海南</option>
                <option value="黑龙江">黑龙江</option>
                <option value="吉林">吉林</option>
                <option value="辽宁">辽宁</option>
                <option value="陕西">陕西</option>
                <option value="青海">青海</option>
                <option value="甘肃">甘肃</option>
                <option value="贵州">贵州</option>
                <option value="新疆">新疆</option>
                <option value="宁夏">宁夏</option>
                <option value="内蒙古">内蒙古</option>
                <option value="西藏">西藏</option>
                <option value="国外">国外</option>
              </select>
         <select class=table name=city_front>
           <option value="0" selected>-城市-</option>
         </select>
</form>

province.js:

// JavaScript Document
var city = new Array();
var num = 0;
city[num++] = new Array("合肥"  ,"安徽");
city[num++] = new Array("安庆"  ,"安徽");
city[num++] = new Array("黄山"  ,"安徽");
city[num++] = new Array("芜湖"  ,"安徽");
city[num++] = new Array("铜陵"  ,"安徽");
city[num++] = new Array("马鞍山" ,"安徽");
city[num++] = new Array("宿县"  ,"安徽");
city[num++] = new Array("六安"  ,"安徽");
city[num++] = new Array("淮北"  ,"安徽");
city[num++] = new Array("淮南"  ,"安徽");
city[num++] = new Array("蚌埠"  ,"安徽");
city[num++] = new Array("亳州"  ,"安徽");
city[num++] = new Array("巢湖"  ,"安徽");
city[num++] = new Array("阜阳"  ,"安徽");
city[num++] = new Array("池州"  ,"安徽");
city[num++] = new Array("滁州"  ,"安徽");
city[num++] = new Array("宣城"  ,"安徽");

city[num++] = new Array("澳门"  ,"澳门");

city[num++] = new Array("东城区" ,"北京");
city[num++] = new Array("西城区" ,"北京");
city[num++] = new Array("崇文区" ,"北京");
city[num++] = new Array("宣武区" ,"北京");
city[num++] = new Array("朝阳区" ,"北京");
city[num++] = new Array("海淀区" ,"北京");
city[num++] = new Array("丰台区" ,"北京");
city[num++] = new Array("石景山区" ,"北京");
city[num++] = new Array("门头沟区" ,"北京");
city[num++] = new Array("房山区" ,"北京");
city[num++] = new Array("通州区" ,"北京");
city[num++] = new Array("平谷区" ,"北京");
city[num++] = new Array("昌平区" ,"北京");
city[num++] = new Array("怀柔区" ,"北京");
city[num++] = new Array("顺义区" ,"北京");
city[num++] = new Array("大兴区" ,"北京");
city[num++] = new Array("延庆县" ,"北京");
city[num++] = new Array("密云县" ,"北京");

city[num++] = new Array("龙宝区" ,"重庆");
city[num++] = new Array("南岸区" ,"重庆");
city[num++] = new Array("沙坪坝区" ,"重庆");
city[num++] = new Array("双桥区" ,"重庆");
city[num++] = new Array("万盛区" ,"重庆");
city[num++] = new Array("万州区" ,"重庆");
city[num++] = new Array("涪陵区" ,"重庆");
city[num++] = new Array("黔江区" ,"重庆");
city[num++] = new Array("江津市" ,"重庆");
city[num++] = new Array("渝北区" ,"重庆");
city[num++] = new Array("巫溪县" ,"重庆");
city[num++] = new Array("垫江县" ,"重庆");
city[num++] = new Array("巫山县" ,"重庆");
city[num++] = new Array("潼南县" ,"重庆");
city[num++] = new Array("大足县" ,"重庆");
city[num++] = new Array("长寿县" ,"重庆");
city[num++] = new Array("云阳县" ,"重庆");
city[num++] = new Array("梁平县" ,"重庆");

city[num++] = new Array("福州"  ,"福建");
city[num++] = new Array("厦门"  ,"福建");
city[num++] = new Array("泉州"  ,"福建");
city[num++] = new Array("漳州"  ,"福建");
city[num++] = new Array("龙岩"  ,"福建");
city[num++] = new Array("莆田"  ,"福建");
city[num++] = new Array("宁德"  ,"福建");
city[num++] = new Array("南平"  ,"福建");
city[num++] = new Array("福清"  ,"福建");
city[num++] = new Array("武夷山" ,"福建");
city[num++] = new Array("晋江"  ,"福建");
city[num++] = new Array("连城"  ,"福建");
city[num++] = new Array("福安"  ,"福建");
city[num++] = new Array("福鼎"  ,"福建");
city[num++] = new Array("三明"  ,"福建");
city[num++] = new Array("邵武"  ,"福建");
city[num++] = new Array("石狮"  ,"福建");

city[num++] = new Array("广州"  ,"广东");
city[num++] = new Array("深圳"  ,"广东");
city[num++] = new Array("珠海"  ,"广东");
city[num++] = new Array("湛江"  ,"广东");
city[num++] = new Array("汕头"  ,"广东");
city[num++] = new Array("中山"  ,"广东");
city[num++] = new Array("佛山"  ,"广东");
city[num++] = new Array("东莞"  ,"广东");
city[num++] = new Array("惠州"  ,"广东");
city[num++] = new Array("肇庆"  ,"广东");
city[num++] = new Array("江门"  ,"广东");
city[num++] = new Array("韶关"  ,"广东");
city[num++] = new Array("顺德"  ,"广东");
city[num++] = new Array("台山"  ,"广东");
city[num++] = new Array("新会"  ,"广东");
city[num++] = new Array("清远"  ,"广东");
city[num++] = new Array("三水"  ,"广东");
city[num++] = new Array("开平"  ,"广东");
city[num++] = new Array("河源"  ,"广东");
city[num++] = new Array("茂名"  ,"广东");
city[num++] = new Array("梅州"  ,"广东");
city[num++] = new Array("南海"  ,"广东");
city[num++] = new Array("普宁"  ,"广东");
city[num++] = new Array("潮阳"  ,"广东");
city[num++] = new Array("番禺"  ,"广东");
city[num++] = new Array("潮州"  ,"广东");
city[num++] = new Array("从化"  ,"广东");
city[num++] = new Array("高要"  ,"广东");
city[num++] = new Array("鹤山"  ,"广东");
city[num++] = new Array("阳江"  ,"广东");

city[num++] = new Array("兰州"  ,"甘肃");
city[num++] = new Array("天水"  ,"甘肃");
city[num++] = new Array("嘉峪关" ,"甘肃");
city[num++] = new Array("酒泉"  ,"甘肃");
city[num++] = new Array("敦煌"  ,"甘肃");
city[num++] = new Array("定西"  ,"甘肃");
city[num++] = new Array("白银"  ,"甘肃");
city[num++] = new Array("金昌"  ,"甘肃");
city[num++] = new Array("甘南"  ,"甘肃");
city[num++] = new Array("临夏"  ,"甘肃");
city[num++] = new Array("陇南"  ,"甘肃");
city[num++] = new Array("平凉"  ,"甘肃");
city[num++] = new Array("庆阳"  ,"甘肃");
city[num++] = new Array("武威"  ,"甘肃");
city[num++] = new Array("张掖"  ,"甘肃");

city[num++] = new Array("南宁"  ,"广西");
city[num++] = new Array("桂林"  ,"广西");
city[num++] = new Array("柳州"  ,"广西");
city[num++] = new Array("北海"  ,"广西");
city[num++] = new Array("百色"  ,"广西");
city[num++] = new Array("防城港" ,"广西");
city[num++] = new Array("贵港"  ,"广西");
city[num++] = new Array("衡阳"  ,"广西");
city[num++] = new Array("桂平"  ,"广西");
city[num++] = new Array("凭祥"  ,"广西");
city[num++] = new Array("钦州"  ,"广西");
city[num++] = new Array("梧州"  ,"广西");
city[num++] = new Array("宜州"  ,"广西");
city[num++] = new Array("玉林"  ,"广西");

city[num++] = new Array("贵阳"  ,"贵州");
city[num++] = new Array("遵义"  ,"贵州");
city[num++] = new Array("安顺"  ,"贵州");
city[num++] = new Array("兴义"  ,"贵州");
city[num++] = new Array("赤水"  ,"贵州");
city[num++] = new Array("都匀"  ,"贵州");
city[num++] = new Array("凯里"  ,"贵州");
city[num++] = new Array("铜仁"  ,"贵州");

city[num++] = new Array("郑州"  ,"河南");
city[num++] = new Array("开封"  ,"河南");
city[num++] = new Array("洛阳"  ,"河南");
city[num++] = new Array("三门峡" ,"河南");
city[num++] = new Array("商丘"  ,"河南");
city[num++] = new Array("南阳"  ,"河南");
city[num++] = new Array("信阳"  ,"河南");
city[num++] = new Array("登封"  ,"河南");
city[num++] = new Array("焦作"  ,"河南");
city[num++] = new Array("灵宝"  ,"河南");
city[num++] = new Array("安阳"  ,"河南");
city[num++] = new Array("项城"  ,"河南");
city[num++] = new Array("平顶山" ,"河南");
city[num++] = new Array("沁阳"  ,"河南");
city[num++] = new Array("汝州"  ,"河南");
city[num++] = new Array("周口"  ,"河南");
city[num++] = new Array("新乡"  ,"河南");
city[num++] = new Array("许昌"  ,"河南");
city[num++] = new Array("益州"  ,"河南");
city[num++] = new Array("禹州"  ,"河南");

city[num++] = new Array("武汉"  ,"湖北");
city[num++] = new Array("宜昌"  ,"湖北");
city[num++] = new Array("襄樊"  ,"湖北");
city[num++] = new Array("黄石"  ,"湖北");
city[num++] = new Array("神农架" ,"湖北");
city[num++] = new Array("鄂州"  ,"湖北");
city[num++] = new Array("黄冈"  ,"湖北");
city[num++] = new Array("沙市"  ,"湖北");
city[num++] = new Array("蒲圻"  ,"湖北");
city[num++] = new Array("潜江"  ,"湖北");
city[num++] = new Array("荆门"  ,"湖北");
city[num++] = new Array("荆州"  ,"湖北");
city[num++] = new Array("麻城"  ,"湖北");
city[num++] = new Array("襄阳"  ,"湖北");
city[num++] = new Array("咸宁"  ,"湖北");
city[num++] = new Array("仙桃"  ,"湖北");
city[num++] = new Array("天门"  ,"湖北");
city[num++] = new Array("十堰"  ,"湖北");
city[num++] = new Array("随州"  ,"湖北");
city[num++] = new Array("孝感"  ,"湖北");

city[num++] = new Array("石家庄" ,"河北");
city[num++] = new Array("保定"  ,"河北");
city[num++] = new Array("秦皇岛" ,"河北");
city[num++] = new Array("承德"  ,"河北");
city[num++] = new Array("邯郸"  ,"河北");
city[num++] = new Array("唐山"  ,"河北");
city[num++] = new Array("沧州"  ,"河北");
city[num++] = new Array("廊坊"  ,"河北");
city[num++] = new Array("衡水"  ,"河北");
city[num++] = new Array("清河县" ,"河北");
city[num++] = new Array("任丘"  ,"河北");
city[num++] = new Array("张家口" ,"河北");
city[num++] = new Array("邢台"  ,"河北");

city[num++] = new Array("香港岛" ,"香港");
city[num++] = new Array("九龙"  ,"香港");
city[num++] = new Array("新界"  ,"香港");
city[num++] = new Array("离岛"  ,"香港");

city[num++] = new Array("哈尔滨" ,"黑龙江");
city[num++] = new Array("齐齐哈尔" ,"黑龙江");
city[num++] = new Array("绥芬河" ,"黑龙江");
city[num++] = new Array("大庆"  ,"黑龙江");
city[num++] = new Array("牡丹江" ,"黑龙江");
city[num++] = new Array("黑河"  ,"黑龙江");
city[num++] = new Array("佳木斯" ,"黑龙江");

city[num++] = new Array("长沙"  ,"湖南");
city[num++] = new Array("岳阳"  ,"湖南");
city[num++] = new Array("张家界" ,"湖南");
city[num++] = new Array("株洲"  ,"湖南");
city[num++] = new Array("常德"  ,"湖南");
city[num++] = new Array("郴州"  ,"湖南");
city[num++] = new Array("大庸"  ,"湖南");
city[num++] = new Array("衡阳"  ,"湖南");
city[num++] = new Array("怀化"  ,"湖南");
city[num++] = new Array("汨罗"  ,"湖南");
city[num++] = new Array("湘潭"  ,"湖南");
city[num++] = new Array("梆州"  ,"湖南");

city[num++] = new Array("海口"  ,"海南");
city[num++] = new Array("万宁"  ,"海南");
city[num++] = new Array("三亚"  ,"海南");
city[num++] = new Array("昌江"  ,"海南");
city[num++] = new Array("琼海"  ,"海南");
city[num++] = new Array("儋州"  ,"海南");
city[num++] = new Array("通什"  ,"海南");
city[num++] = new Array("文昌"  ,"海南");

city[num++] = new Array("长春"  ,"吉林");
city[num++] = new Array("吉林"  ,"吉林");
city[num++] = new Array("抚顺"  ,"吉林");
city[num++] = new Array("白山"  ,"吉林");
city[num++] = new Array("龙井"  ,"吉林");
city[num++] = new Array("四平"  ,"吉林");
city[num++] = new Array("延吉市" ,"吉林");
city[num++] = new Array("通化"  ,"吉林");
city[num++] = new Array("梅河口" ,"吉林");

city[num++] = new Array("南京"  ,"江苏");
city[num++] = new Array("苏州"  ,"江苏");
city[num++] = new Array("无锡"  ,"江苏");
city[num++] = new Array("常州"  ,"江苏");
city[num++] = new Array("徐州"  ,"江苏");
city[num++] = new Array("扬州"  ,"江苏");
city[num++] = new Array("连云港" ,"江苏");
city[num++] = new Array("镇江"  ,"江苏");
city[num++] = new Array("张家港" ,"江苏");
city[num++] = new Array("盐城"  ,"江苏");
city[num++] = new Array("锡山"  ,"江苏");
city[num++] = new Array("吴江"  ,"江苏");
city[num++] = new Array("泰州"  ,"江苏");
city[num++] = new Array("常熟"  ,"江苏");
city[num++] = new Array("丹阳"  ,"江苏");
city[num++] = new Array("高邮"  ,"江苏");
city[num++] = new Array("昆山"  ,"江苏");
city[num++] = new Array("淮阴"  ,"江苏");
city[num++] = new Array("江都"  ,"江苏");
city[num++] = new Array("江阴"  ,"江苏");
city[num++] = new Array("句容"  ,"江苏");
city[num++] = new Array("南通"  ,"江苏");
city[num++] = new Array("宜兴"  ,"江苏");

city[num++] = new Array("南昌"  ,"江西");
city[num++] = new Array("九江"  ,"江西");
city[num++] = new Array("鹰潭"  ,"江西");
city[num++] = new Array("景德镇" ,"江西");
city[num++] = new Array("赣州"  ,"江西");
city[num++] = new Array("上饶"  ,"江西");
city[num++] = new Array("井冈山" ,"江西");
city[num++] = new Array("吉安"  ,"江西");
city[num++] = new Array("抚州"  ,"江西");
city[num++] = new Array("丰城"  ,"江西");
city[num++] = new Array("萍乡"  ,"江西");
city[num++] = new Array("新余"  ,"江西");
city[num++] = new Array("宜春"  ,"江西");

city[num++] = new Array("沈阳"  ,"辽宁");
city[num++] = new Array("大连"  ,"辽宁");
city[num++] = new Array("抚顺"  ,"辽宁");
city[num++] = new Array("锦州"  ,"辽宁");
city[num++] = new Array("阜新"  ,"辽宁");
city[num++] = new Array("丹东"  ,"辽宁");
city[num++] = new Array("鞍山"  ,"辽宁");
city[num++] = new Array("本溪"  ,"辽宁");
city[num++] = new Array("辽阳"  ,"辽宁");
city[num++] = new Array("葫芦岛" ,"辽宁");
city[num++] = new Array("兴城"  ,"辽宁");
city[num++] = new Array("营口"  ,"辽宁");

city[num++] = new Array("呼和浩特" ,"内蒙古");
city[num++] = new Array("包头"  ,"内蒙古");
city[num++] = new Array("满洲里市" ,"内蒙古");
city[num++] = new Array("海拉尔" ,"内蒙古");
city[num++] = new Array("赤峰"  ,"内蒙古");
city[num++] = new Array("东胜"  ,"内蒙古");
city[num++] = new Array("扎兰屯" ,"内蒙古");
city[num++] = new Array("锡林浩特" ,"内蒙古");
city[num++] = new Array("牙克石" ,"内蒙古");

city[num++] = new Array("银川"  ,"宁夏");
city[num++] = new Array("中卫"  ,"宁夏");
city[num++] = new Array("固原"  ,"宁夏");
city[num++] = new Array("石嘴山" ,"宁夏");
city[num++] = new Array("同心"  ,"宁夏");

city[num++] = new Array("西宁"  ,"青海");
city[num++] = new Array("海南州" ,"青海");
city[num++] = new Array("海东地区" ,"青海");
city[num++] = new Array("海西"  ,"青海");
city[num++] = new Array("黄南州" ,"青海");
city[num++] = new Array("果洛"  ,"青海");
city[num++] = new Array("海北"  ,"青海");
city[num++] = new Array("玉树"  ,"青海");
city[num++] = new Array("湟中县" ,"青海");

city[num++] = new Array("成都"  ,"四川");
city[num++] = new Array("宜宾"  ,"四川");
city[num++] = new Array("自贡"  ,"四川");
city[num++] = new Array("绵阳"  ,"四川");
city[num++] = new Array("峨嵋山" ,"四川");
city[num++] = new Array("九寨沟" ,"四川");
city[num++] = new Array("阿坝州" ,"四川");
city[num++] = new Array("广元"  ,"四川");
city[num++] = new Array("甘孜"  ,"四川");
city[num++] = new Array("乐山"  ,"四川");
city[num++] = new Array("德阳"  ,"四川");
city[num++] = new Array("松潘"  ,"四川");
city[num++] = new Array("西昌"  ,"四川");
city[num++] = new Array("泸州"  ,"四川");
city[num++] = new Array("木里"  ,"四川");
city[num++] = new Array("攀枝花" ,"四川");
city[num++] = new Array("广汉"  ,"四川");
city[num++] = new Array("剑阁"  ,"四川");
city[num++] = new Array("江油"  ,"四川");
city[num++] = new Array("康定"  ,"四川");

city[num++] = new Array("济南"  ,"山东");
city[num++] = new Array("青岛"  ,"山东");
city[num++] = new Array("威海"  ,"山东");
city[num++] = new Array("烟台"  ,"山东");
city[num++] = new Array("淄博"  ,"山东");
city[num++] = new Array("潍坊"  ,"山东");
city[num++] = new Array("聊城"  ,"山东");
city[num++] = new Array("曲阜"  ,"山东");
city[num++] = new Array("泰安"  ,"山东");
city[num++] = new Array("枣庄"  ,"山东");
city[num++] = new Array("文登"  ,"山东");
city[num++] = new Array("日照"  ,"山东");
city[num++] = new Array("荣城"  ,"山东");
city[num++] = new Array("临沂"  ,"山东");
city[num++] = new Array("蓬莱"  ,"山东");
city[num++] = new Array("济宁"  ,"山东");
city[num++] = new Array("德州"  ,"山东");

city[num++] = new Array("黄浦区" ,"上海");
city[num++] = new Array("长宁区" ,"上海");
city[num++] = new Array("徐汇区" ,"上海");
city[num++] = new Array("静安区" ,"上海");
city[num++] = new Array("浦东新区" ,"上海");
city[num++] = new Array("虹口区" ,"上海");
city[num++] = new Array("卢湾区" ,"上海");
city[num++] = new Array("杨浦区" ,"上海");
city[num++] = new Array("普陀区" ,"上海");
city[num++] = new Array("青浦区" ,"上海");
city[num++] = new Array("闵行区" ,"上海");
city[num++] = new Array("嘉定区" ,"上海");
city[num++] = new Array("金山区" ,"上海");
city[num++] = new Array("闸北区" ,"上海");
city[num++] = new Array("宝山区" ,"上海");
city[num++] = new Array("松江区" ,"上海");
city[num++] = new Array("奉贤县" ,"上海");
city[num++] = new Array("南汇县" ,"上海");
city[num++] = new Array("崇明县" ,"上海");

city[num++] = new Array("西安"  ,"陕西");
city[num++] = new Array("延安"  ,"陕西");
city[num++] = new Array("咸阳"  ,"陕西");
city[num++] = new Array("宝鸡"  ,"陕西");
city[num++] = new Array("韩城"  ,"陕西");
city[num++] = new Array("汉中"  ,"陕西");

city[num++] = new Array("太原"  ,"山西");
city[num++] = new Array("大同"  ,"山西");
city[num++] = new Array("运城"  ,"山西");
city[num++] = new Array("洪洞"  ,"山西");
city[num++] = new Array("侯马"  ,"山西");
city[num++] = new Array("临汾"  ,"山西");
city[num++] = new Array("朔州"  ,"山西");
city[num++] = new Array("忻州"  ,"山西");
city[num++] = new Array("阳泉"  ,"山西");

city[num++] = new Array("和平区" ,"天津");
city[num++] = new Array("河东区" ,"天津");
city[num++] = new Array("河西区" ,"天津");
city[num++] = new Array("南开区" ,"天津");
city[num++] = new Array("红桥区" ,"天津");
city[num++] = new Array("河北区" ,"天津");
city[num++] = new Array("塘沽区" ,"天津");
city[num++] = new Array("汉沽区" ,"天津");
city[num++] = new Array("大港区" ,"天津");
city[num++] = new Array("东丽区" ,"天津");
city[num++] = new Array("津南区" ,"天津");
city[num++] = new Array("西青区" ,"天津");
city[num++] = new Array("北辰区" ,"天津");
city[num++] = new Array("静海县" ,"天津");
city[num++] = new Array("武清县" ,"天津");
city[num++] = new Array("宁河县" ,"天津");
city[num++] = new Array("宝坻县" ,"天津");
city[num++] = new Array("蓟  县" ,"天津");

city[num++] = new Array("台北市" ,"台湾");
city[num++] = new Array("高雄市" ,"台湾");
city[num++] = new Array("基隆市" ,"台湾");
city[num++] = new Array("台中市" ,"台湾");
city[num++] = new Array("台南市" ,"台湾");
city[num++] = new Array("新竹市" ,"台湾");
city[num++] = new Array("嘉义市" ,"台湾");


city[num++] = new Array("乌鲁木齐" ,"新疆");
city[num++] = new Array("吐鲁番" ,"新疆");
city[num++] = new Array("喀什"  ,"新疆");
city[num++] = new Array("克拉玛依" ,"新疆");
city[num++] = new Array("伊宁"  ,"新疆");
city[num++] = new Array("库尔勒" ,"新疆");
city[num++] = new Array("哈密"  ,"新疆");
city[num++] = new Array("和田"  ,"新疆");
city[num++] = new Array("奎屯"  ,"新疆");
city[num++] = new Array("石河子" ,"新疆");

city[num++] = new Array("拉萨"  ,"西藏");
city[num++] = new Array("日喀则" ,"西藏");
city[num++] = new Array("山南地区" ,"西藏");
city[num++] = new Array("那曲"  ,"西藏");
city[num++] = new Array("林芝"  ,"西藏");
city[num++] = new Array("阿里"  ,"西藏");
city[num++] = new Array("昌都"  ,"西藏");

city[num++] = new Array("昆明"  ,"云南");
city[num++] = new Array("大理"  ,"云南");
city[num++] = new Array("西双版纳" ,"云南");
city[num++] = new Array("红河州" ,"云南");
city[num++] = new Array("德宏/芒市" ,"云南");
city[num++] = new Array("丽江"  ,"云南");
city[num++] = new Array("玉溪"  ,"云南");
city[num++] = new Array("怒江州" ,"云南");
city[num++] = new Array("楚雄"  ,"云南");
city[num++] = new Array("瑞丽"  ,"云南");
city[num++] = new Array("腾冲"  ,"云南");
city[num++] = new Array("维西"  ,"云南");

city[num++] = new Array("杭州"  ,"浙江");
city[num++] = new Array("绍兴"  ,"浙江");
city[num++] = new Array("宁波"  ,"浙江");
city[num++] = new Array("温州"  ,"浙江");
city[num++] = new Array("金华"  ,"浙江");
city[num++] = new Array("嘉兴"  ,"浙江");
city[num++] = new Array("舟山"  ,"浙江");
city[num++] = new Array("诸暨"  ,"浙江");
city[num++] = new Array("台州"  ,"浙江");
city[num++] = new Array("衢州"  ,"浙江");
city[num++] = new Array("丽水"  ,"浙江");
city[num++] = new Array("湖州"  ,"浙江");


city[num++] = new Array("美国"  ,"国外");
city[num++] = new Array("日本"  ,"国外");
city[num++] = new Array("英国"  ,"国外");
city[num++] = new Array("加拿大" ,"国外");
city[num++] = new Array("澳大利亚" ,"国外");
city[num++] = new Array("法国"  ,"国外");
city[num++] = new Array("德国"  ,"国外");
city[num++] = new Array("俄罗斯" ,"国外");
city[num++] = new Array("韩国"  ,"国外");
city[num++] = new Array("马来西亚" ,"国外");
city[num++] = new Array("泰国"  ,"国外");
city[num++] = new Array("新加坡" ,"国外");
city[num++] = new Array("瑞士"  ,"国外");
city[num++] = new Array("其他国家" ,"国外");


var nCityCount = num;


function ProvinceChange(cmbProvince, cmbCity)
{
 var nSelProvince = cmbProvince.selectedIndex;
 var sProvince = cmbProvince.options[nSelProvince].value;

 cmbCity.length = 0;
 cmbCity.options[0] = new Option('-选择-', '');
 for(var i=0; i<nCityCount; i++)
 {
  if(city[i][1] == sProvince)
  {
   cmbCity.options[cmbCity.length] = new Option(city[i][0], city[i][0]);
  }
 }
 cmbCity.options[0].selected = true;
}

function InitCity(cmbProvince, cmbCity)
{
 var nSelProvince = cmbProvince.selectedIndex;
 var sProvince = cmbProvince.options[nSelProvince].value;
 var sCity = cmbCity.options[0].value;


 cmbCity.length = 0;
 cmbCity.options[0] = new Option('-请选择-', '');
 var n = 0;
 for(var i=0; i<nCityCount; i++)
 {
  if(city[i][1] == sProvince)
  {
   cmbCity.options[cmbCity.length] = new Option(city[i][0], city[i][0]);
   
   if(city[i][0] == sCity)
    cmbCity.options[cmbCity.length-1].selected = true;
  }
 }
}


 

相关文章推荐

JS自定义日期级联

  • 2016年12月20日 10:57
  • 4KB
  • 下载

javascript_js_三级级联例子

  • 2011年03月04日 17:29
  • 8KB
  • 下载

省市数组js数组,城市级联下拉会用到

/*    city.js   BusinessOn   Created by 吴小海 on 12-4-5.   Copyright 2012年 蓝运方小. A...

JS实现无延迟级联菜单

1.一般的级联菜单,当我们鼠标滑动到一级菜单上的每一个li上时显示对应的二级菜单。可是这种传统的级联菜单有一个很差的用户体验:我们必须在这个li元素上平行的移动鼠标,才能将鼠标移动到对应的二级菜单中。...

级联js操作

  • 2014年11月11日 15:24
  • 3KB
  • 下载

JS时间级联

  • 2014年03月25日 16:58
  • 1KB
  • 下载

js 省市县三级级联

选择省份 选择城市 选择区县 /** * 在appr.js 前的html 中定义 */ //定义当前页面初始化值 var selectedProvince ...
  • okttl01
  • okttl01
  • 2016年06月17日 13:33
  • 3239

JS级联菜单

  • 2014年03月31日 14:00
  • 1KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Js级联
举报原因:
原因补充:

(最多只允许输入30个字)