分享
 
 
 

省名与城名下拉选择框联动

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

表单中,第一个列表框有a,b,c三个选项,当用户选中a时,第二个列表框显示a1,a2,a3三个选项,(若用户在第一个列表框中选择b,第二个列表框显示b1,b2,b3,以此类推),当用户在第二个列表框中选择a1,第三个列表框中显示a11,a12,a13。请问如何实现?

---------------------------------------------------------------

给你一个,以此类推

<script LANGUAGE="javascript">

<!--

var onecount;

onecount=0;

subcat = new Array();

subcat[0] = new Array("徐汇区","01","001");

subcat[1] = new Array("嘉定区","01","002");

subcat[2] = new Array("黄浦区","01","003");

subcat[3] = new Array("南昌市","02","004");

subcat[4] = new Array("九江市","02","005");

subcat[5] = new Array("上饶市","02","006");

onecount=6;

function changelocation(locationid)

{

document.myform.smalllocation.length = 0;

var locationid=locationid;

var i;

document.myform.smalllocation.options[0] = new Option('====所有地区====','');

for (i=0;i < onecount; i++)

{

if (subcat[i][1] == locationid)

{

document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);

}

}

}

//-->

</script>

</head>

<form name="myform" method="post">

<select name="biglocation" onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)">

<option value="01" selected>上海</option>

<option value="02">江西</option>

</select>

<select name="smalllocation">

<option selected value="">==所有地区==</option>

</select>

</form>

---------------------------------------------------------------

<script language=JavaScript>

<!--

ct = new Array();

ct[0] = "none";

//直辖市--北京 1,1

ct[1] = "北京";

//直辖市--上海 2,1

ct[2] = "上海";

//直辖市--天津 3,1

ct[3] = "天津";

//直辖市--重庆 4,1

ct[4] = "重庆";

//河北省的主要城市 5,10

ct[5] = "石家庄";

ct[6] = "保定";

ct[7] = "秦皇岛";

ct[8] = "邯郸";

ct[9] = "承德";

ct[10] = "廊坊";

ct[11] = "张家口";

ct[12] = "沧州";

ct[13] = "邢台";

ct[14] = "唐";

//山西省的主要城市 15,10

ct[15] = "太原";

ct[16] = "长治";

ct[17] = "大同";

ct[18] = "临汾";

ct[19] = "山阴";

ct[20] = "忻州";

ct[21] = "阳泉";

ct[22] = "原平";

ct[23] = "泽州";

ct[24] = "太谷";

//内蒙古自治区的主要城市 25,10

ct[25] = "呼和浩特";

ct[26] = "包头";

ct[27] = "乌海";

ct[28] = "临河";

ct[29] = "东胜";

ct[30] = "赤峰";

ct[31] = "通辽";

ct[32] = "锡林浩特";

ct[33] = "乌兰浩特";

ct[34] = "海拉尔";

//辽宁省的主要城市";35,10

ct[35] = "沈阳";

ct[36] = "大连";

ct[37] = "鞍山";

ct[38] = "抚顺";

ct[39] = "本溪";

ct[40] = "丹东";

ct[41] = "锦州";

ct[42] = "营口";

ct[43] = "辽阳";

ct[44] = "铁岭";

//吉林省的主要城市;45,9

ct[45] = "长春";

ct[46] = "白城";

ct[47] = "松原";

ct[48] = "四平";

ct[49] = "吉林";

ct[50] = "辽源";

ct[51] = "白山";

ct[52] = "通化";

ct[53] = "延边";

//黑龙江省的主要城市;54,10

ct[54] = "哈尔滨";

ct[55] = "大庆";

ct[56] = "黑河";

ct[57] = "鸡西";

ct[58] = "佳木斯";

ct[59] = "牡丹江";

ct[60] = "嫩江";

ct[61] = "齐齐哈尔";

ct[62] = "绥化";

ct[63] = "伊春";

//江苏省的主要城市;64,12

ct[64] = "南京";

ct[65] = "苏州";

ct[66] = "无锡";

ct[67] = "常州";

ct[68] = "镇江";

ct[69] = "扬州";

ct[70] = "南通";

ct[71] = "徐州";

ct[72] = "连云港";

ct[73] = "淮阴";

ct[74] = "泰州";

ct[75] = "宿迁";

//浙江省的主要城市;76,10

ct[76] = "杭州";

ct[77] = "金华";

ct[78] = "宁波";

ct[79] = "温州";

ct[80] = "湖州";

ct[81] = "绍兴";

ct[82] = "嘉兴";

ct[83] = "台州";

ct[84] = "舟山";

ct[85] = "丽水";

//安徽省的主要城市;86,10

ct[86] = "合肥";

ct[87] = "芜湖";

ct[88] = "蚌埠";

ct[89] = "阜阳";

ct[90] = "淮南";

ct[91] = "淮北";

ct[92] = "六安";

ct[93] = "马鞍山";

ct[94] = "铜陵";

ct[95] = "安庆";

// 福建省的主要城市;96,9

ct[96] = "福州";

ct[97] = "厦门";

ct[98] = "泉州";

ct[99] = "漳州";

ct[100] = "龙岩";

ct[101] = "南平";

ct[102] = "宁德";

ct[103] = "莆田";

ct[104] = "三明";

//江西省的主要城市;105,10

ct[105] = "南昌";

ct[106] = "九江";

ct[107] = "新余";

ct[108] = "赣州";

ct[109] = "景德镇";

ct[110] = "上饶";

ct[111] = "抚州";

ct[112] = "宜春";

ct[113] = "吉安";

ct[114] = "鹰潭";

//山东省的主要城市;115,10

ct[115] = "济南";

ct[116] = "青岛";

ct[117] = "淄博";

ct[118] = "德州";

ct[119] = "烟台";

ct[120] = "潍坊";

ct[121] = "济宁";

ct[122] = "枣庄";

ct[123] = "日照";

ct[124] = "莱芜";

//河南省的主要城市;125,10

ct[125] = "洛阳";

ct[126] = "焦作";

ct[127] = "开封";

ct[128] = "南阳";

ct[129] = "平顶山";

ct[130] = "三门峡";

ct[131] = "商丘";

ct[132] = "许昌";

ct[133] = "郑州";

ct[134] = "驻马店";

//ct[134] = "鹤壁";

//湖北省的主要城市;135,10

ct[135] = "武汉";

ct[136] = "宜昌";

ct[137] = "十堰";

ct[138] = "咸宁";

ct[139] = "黄石";

ct[140] = "黄冈";

ct[141] = "襄阳";

ct[142] = "宜城";

ct[143] = "襄樊";

ct[144] = "荆州";

//湖南省的主要城市;145,10

ct[145] = "长沙";

ct[146] = "株洲";

ct[147] = "湘潭";

ct[148] = "常德";

ct[149] = "衡阳";

ct[150] = "岳阳";

ct[151] = "怀化";

ct[152] = "永州";

ct[153] = "自治洲";

ct[154] = "张家界";

//广东省的主要城市;155,8

[1] [2] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有