求助asp 关于分类的问题 20
我想做出如图的效果,分类A是一级分类而A1是二级分类,点击分类分类A的时候显示二级分类信息,点击分类B的时候显示分类B的信息,求ASP代码!...
我想做出如图的效果,分类A 是一级分类 而A1 是二级分类,点击分类分类A 的时候显示二级分类信息,点击分类B 的时候显示分类B 的信息,求ASP代码!
展开
1个回答
展开全部
这个只需要用JS就可以了,你看看这个,你自己改一下吧:
<html>
<head>
<title>New Document </title>
<script language="JavaScript" type="text/javascript">
var city=[
["北京","天津","上海","重庆"],
["南京","苏州","南通","常州"],
["福州","福安","龙岩","南平"],
["广州","潮阳","潮州","澄海"],
["兰州","白银","定西","敦煌"]
];
function getCity(){
var sltProvince=document.getElementById("province");
var sltCity=document.getElementById("city");
var provinceCity=city[sltProvince.selectedIndex-1];
sltCity.length=1;
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
</script>
</head>
<body>
<form action="somepage.asp" name=theForm">
<select name="province" id="province" onchange="getCity()">
<option value="0">请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="江苏省">江苏省</option>
<option value="福建省">福建省</option>
<option value="广东省">广东省</option>
<option value="甘肃省">甘肃省</option>
</select>
<select id="city" name="city">
<option value="0">请选择所在城市</option>
</select>
</form>
</body>
</html>
<html>
<head>
<title>New Document </title>
<script language="JavaScript" type="text/javascript">
var city=[
["北京","天津","上海","重庆"],
["南京","苏州","南通","常州"],
["福州","福安","龙岩","南平"],
["广州","潮阳","潮州","澄海"],
["兰州","白银","定西","敦煌"]
];
function getCity(){
var sltProvince=document.getElementById("province");
var sltCity=document.getElementById("city");
var provinceCity=city[sltProvince.selectedIndex-1];
sltCity.length=1;
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
</script>
</head>
<body>
<form action="somepage.asp" name=theForm">
<select name="province" id="province" onchange="getCity()">
<option value="0">请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="江苏省">江苏省</option>
<option value="福建省">福建省</option>
<option value="广东省">广东省</option>
<option value="甘肃省">甘肃省</option>
</select>
<select id="city" name="city">
<option value="0">请选择所在城市</option>
</select>
</form>
</body>
</html>
Storm代理
2023-08-29 广告
2023-08-29 广告
StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,IP...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询