<script language=”javascript” src=”city.js”></script>
<form action=”" method=”post” name=”form2″>省份:<select name=”sf” onchange=”changecity()” >
<option 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></select>
城市:
<SELECT name=city style=”width:80″>
<OPTION>==所在城市==</OPTION>
</SELECT>
</form>
city.js 代碼:
// JavaScript Document
function changecity(){
index = form2.sf.options.selectedIndex-1;
form2.city.length = city[index].length;
for(var i = 0;i<city[index].length;i++)
{
var text = city[index][i].split(“-”);
form2.city.options[i].text = text[0];
form2.city.options[i].value =text[1];
}
}var city = new Array(
new Array(
//”江蘇省(全部地區(qū))-江蘇省(全部地區(qū))”,
“江陰市-江陰市”,
“無錫市-無錫市”,
“宜興市-宜興市”,
“常州市-常州市”,
“南京市-南京市”,
“溧水縣-溧水縣”,
“高淳縣-高淳縣”,
“蘇州市-蘇州市”,
“常熟市-常熟市”,
“張家港市-張家港市”,
“昆山市-昆山市”,
“吳江市-吳江市”,
“太倉市-太倉市”,
“溧陽市-溧陽市”,
“金壇市-金壇市”,
“南通市-南通市”,
“海安縣-海安縣”,
“如東縣-如東縣”,
“啟東市-啟東市”,
“如皋市-如皋市”,
“通州市-通州市”,
“海門市-海門市”,
“鎮(zhèn)江市-鎮(zhèn)江市”,
“丹陽市-丹陽市”,
“揚中市-揚中市”,
“句容市-句容市”,
“徐州市-徐州市”,
“豐縣-豐縣”,
“沛縣-沛縣”,
“銅山縣-銅山縣”,
“睢寧縣-睢寧縣”,
“新沂市-新沂市”,
“邳州市-邳州市”,
“連云港市-連云港市”,
“贛榆縣-贛榆縣”,
“東?h-東?h”,
“灌云縣-灌云縣”,
“淮安市-淮安市”,
“漣水縣-漣水縣”,
“洪澤縣-洪澤縣”,
“盱眙縣-盱眙縣”,
“金湖縣-金湖縣”,
“鹽城市-鹽城市”,
“響水縣-響水縣”,
“濱?h-濱?h”,
“阜寧縣-阜寧縣”,
“射陽縣-射陽縣”,
“建湖縣-建湖縣”,
“鹽都縣-鹽都縣”,
“東臺縣-東臺縣”,
“大豐市-大豐市”,
“揚州市-揚州市”,
“寶應(yīng)縣-寶應(yīng)縣”,
“儀征縣-儀征縣”,
“高郵市-高郵市”,
“江都市-江都市”,
“宿遷市-宿遷市”,
“宿豫縣-宿豫縣”,
“沭陽縣-沭陽縣”,
“泗陽縣-泗陽縣”,
“泗洪縣-泗洪縣”,
“泰州市-泰州市”,
“興化市-興化市”,
“靖江市-靖江市”,
“泰興市-泰興市”,
“姜堰市-姜堰市”),
new Array(“北京-北京”),
new Array(“天津-天津”),
new Array(“上海-上海”),
new Array(“重慶-重慶”),
new Array(
//”廣東省 (全部地區(qū))-廣東省 (全部地區(qū))”,
“廣州-廣州”,
“深圳-深圳”,
“東莞-東莞”,
“中山-中山”,
“佛山-佛山”,
“珠海-珠海”,
“惠州-惠州”,
“汕頭-汕頭”,
“湛江-湛江”,
“潮州-潮州”,
“潮陽-潮陽”,
“江門-江門”,
“汕尾-汕尾”,
“茂名-茂名”,
“陽江-陽江”,
“肇慶-肇慶”,
“梅州-梅州”,
“云浮-云浮”,
“清遠-清遠”,
“韶關(guān)-韶關(guān)”,
“河源-河源”,
“揭陽-揭陽”,
“其他-其他”),
new Array(
//”浙江省(全部地區(qū))-浙江省(全部地區(qū))”,
“杭州-杭州”,
“寧波-寧波”,
“溫州-溫州”,
“金華-金華”,
“義烏-義烏”,
“紹興-紹興”,
“湖州-湖州”,
“余姚-余姚”,
“臨海-臨海”,
“蕭山-蕭山”,
“臨安-臨安”,
“諸暨-諸暨”,
“嵊泗-嵊泗”,
“蘭溪-蘭溪”,
“嘉興-嘉興”,
“海寧-海寧”,
“桐鄉(xiāng)-桐鄉(xiāng)”,
“衢州-衢州”,
“上虞-上虞”,
“嵊州-嵊州”,
“慈溪-慈溪”,
“麗水-麗水”,
“甌海-甌海”,
“黃巖-黃巖”,
“椒江-椒江”,
“其他-其他”),
new Array(
//”福建省(全部地區(qū))-福建省(全部地區(qū))”,
“福州-福州”,
“廈門-廈門”,
“泉州-泉州”,
“漳州-漳州”,
“石獅-石獅”,
“三明-三明”,
“南平-南平”,
“莆田-莆田”,
“永安-永安”,
“邵武-邵武”,
“龍巖-龍巖”,
“其他-其他”)); |