简明现代魔法 -> JavaScript -> JavaScript 省市县三级联动

JavaScript 省市县三级联动

2010-03-16

效果演示

省市联动 出生地:
所在地:
工作地:

省市地区联动 出   生  地:
户 口 所 在 地:
工 作 所 在 地:

无  默  认:
默  认  省:
默 认 省 市:
默 认 省 市 区:

示例代码下载

HTML 前端调用代码:

<fieldset style="padding:5px;">
<legend>省市联动</legend>
出生地:<select name="P1"></select><select name="C1"></select><br>
所在地:<select name="P2"></select><select name="C2"></select><br>
工作地:<select name="P3"></select><select name="C3"></select><br>
</fieldset>

<br>

<fieldset style="padding:5px;">
<legend>省市地区联动</legend>
出   生  地:<select name="province"></select><select name="city"></select><select name="area"></select><br>
户 口 所 在 地:<select name="province1"></select><select name="city1"></select><select name="area1"></select><br>
工 作 所 在 地:<select name="province2"></select><select name="city2"></select><select name="area2"></select><br>
<br>
无  默  认:<select name="province3"></select><select name="city3"></select><select name="area3"></select><br>
默  认  省:<select name="province4"></select><select name="city4"></select><select name="area4"></select><br>
默 认 省 市:<select name="province5"></select><select name="city5"></select><select name="area5"></select><br>
默 认 省 市 区:<select name="province6"></select><select name="city6"></select><select name="area6"></select><br>
</fieldset>
<script language="javascript" defer>
new PCAS("P1","C1");
new PCAS("P2","C2","吉林省");
new PCAS("P3","C3","江苏省","苏州市");

new PCAS("province","city","area","吉林省","白城市","大安市");
new PCAS("province1","city1","area1","吉林省","吉林市","龙潭区");
new PCAS("province2","city2","area2","江苏省","苏州市","沧浪区");

new PCAS("province3","city3","area3");
new PCAS("province4","city4","area4","江苏省");
new PCAS("province5","city5","area5","江苏省","苏州市");
new PCAS("province6","city6","area6","江苏省","苏州市","沧浪区");
</script>

随机文章推荐
网站分类


注:如需转载本文,请注明出处(原文链接),谢谢。更多精彩内容,请进入简明现代魔法首页。

进入新博客
喜欢本文,就分享它吧
给我留言
您的名字:
您的邮件:
您的网站:


 

copyright © 2009 简明现代魔法    学习、分享、进步

power by Gonn 感谢所有关心和支持本站的朋友们