关于ASP三级联动的问题

<scriptlanguage="JavaScript">varonecount;varthreecount;onecount=0;threecount=0subcat3... <script language = "JavaScript">
var onecount;
var threecount;
onecount=0;
threecount=0

subcat3=new Array();

subcat3[0] = new Array("111","582","642");

subcat3[1] = new Array("1111","578","614");

threecount=2;

subcat = new Array();

subcat[0] = new Array("","0","610");

subcat[1] = new Array("助油","58","584");

subcat[2] = new Array("项链","56","576");

onecount=3;

function changelocation(locationid)
{
document.myform.shopxpse_id.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.shopxpse_id.options[document.myform.shopxpse_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
changelocation3(document.myform.shopxpse_id.options[document.myform.shopxpse_id.selectedIndex].value)

}

function changelocation3(locationid)
{
document.myform.xclassid.length = 0;

var locationid=locationid;
var i;
for (i=0;i < threecount; i++)
{
if (subcat3[i][1] == locationid)
{
document.myform.xclassid.options[document.myform.xclassid.length] = new Option(subcat3[i][0], subcat3[i][2]);
}
}

}
//-->
</script>
<body>
<form name="myform" method="post" action="sshopxpaddpt.asp?action=add" OnSubmit="return checkkk()" >
<table width="96%" border="0" cellpadding="0" cellspacing="5" bgcolor="#F1F3F5">
<tr >
<td width="23%" align="right">选择商品的分类:</td>
<td width="77%">

大类:
<select name="shopxpbe_id" size="1" id="shopxpbe_id" onChange="changelocation(document.myform.shopxpbe_id.options[document.myform.shopxpbe_id.selectedIndex].value)">
<option value="64">系统配件</option>
<option value="63">机身配件</option>
<option value="71">电子电器</option>
<option value="56">功能附件</option>
<option value="55">排屑器</option>
<option value="57">油冷机</option>
<option value="80">光栅尺</option>
<option value="82">第四轴</option>
<option value="58">刀库</option>
<option value="81">更多/其它商品</option>
</select>

   小类:

<select name="shopxpse_id" size="1" id="shopxpse_id" onChange="changelocation3(document.myform.shopxpse_id.options[document.myform.shopxpse_id.selectedIndex].value)">
<option value="568">主轴</option>
<option value="569">丝杆</option>

</select>

三级分类:

<select name="xclassid">
暂时没有子分类

</td>
</tr>
二级分类怎么无法联动啊?在线求
展开
 我来答
yongxi1009
推荐于2016-04-12 · TA获得超过291个赞
知道小有建树答主
回答量:284
采纳率:0%
帮助的人:355万
展开全部
<script language = "JavaScript">
var onecount;
var threecount;
onecount=0;
threecount=0

subcat3=new Array();

subcat3[0] = new Array("111","582","642");

subcat3[1] = new Array("1111","578","614");

threecount=2;

subcat = new Array();

subcat[0] = new Array("","0","610");

subcat[1] = new Array("助油","58","584");

subcat[2] = new Array("项链","56","576");

onecount=3;

function changelocation(locationid)
{
document.myform.shopxpse_id.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.shopxpse_id.options[document.myform.shopxpse_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
changelocation3(document.myform.shopxpse_id.options[document.myform.shopxpse_id.selectedIndex].value)

}

function changelocation3(locationid)
{
document.myform.xclassid.length = 0;

var locationid=locationid;
var i;
for (i=0;i < threecount; i++)
{
if (subcat3[i][1] == locationid)
{
document.myform.xclassid.options[document.myform.xclassid.length] = new Option(subcat3[i][0], subcat3[i][2]);
}
}

}
//-->
</script>
<body>
<form name="myform" method="post" action="sshopxpaddpt.asp?action=add" OnSubmit="return checkkk()" >
<table width="96%" border="0" cellpadding="0" cellspacing="5" bgcolor="#F1F3F5">
<tr >
<td width="23%" align="right">选择商品的分类:</td>
<td width="77%">

大类:
<select name="shopxpbe_id" size="1" id="shopxpbe_id" onChange="changelocation(document.myform.shopxpbe_id.options[document.myform.shopxpbe_id.selectedIndex].value)">
<option value="64">系统配件</option>
<option value="63">机身配件</option>
<option value="71">电子电器</option>
<option value="56">功能附件</option>
<option value="55">排屑器</option>
<option value="57">油冷机</option>
<option value="80">光栅尺</option>
<option value="82">第四轴</option>
<option value="58">刀库</option>
<option value="81">更多/其它商品</option>
</select>

小类:

<select name="shopxpse_id" size="1" id="shopxpse_id" onChange="changelocation3(document.myform.shopxpse_id.options[document.myform.shopxpse_id.selectedIndex].value)">
<option value="568">主轴</option>
<option value="569">丝杆</option>

</select>

三级分类:

<select name="xclassid">
<option>暂时没有分类</option>
<option value="584">主轴</option>
</select>

</td>
</tr> </table>

可以联动啊, 可HI上联系我
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
Storm代理
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I... 点击进入详情页
本回答由Storm代理提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式