主题:  请教下拉框(select 窗体)二级关连跳转要怎么做?

yugangyan

职务:普通成员
等级:1
金币:0.0
发贴:122
#12006/4/24 10:11:41

图片如下:

每个大类里面有小类。我想实现点击前面大类后,其对应的小类就显示在第二个下拉框里面。请问要代码要怎么写?



yiliaocheng

职务:普通成员
等级:2
金币:2.0
发贴:631
#22006/4/24 18:17:07
<script language = "javascript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName")%>","<%= trim(rs("BigClassName")%>","<%= trim(rs("SmallClassName")%>";
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;

function changelocation(locationid)
{
document.addNEWS.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.addNEWS.SmallClassName.options[document.addNEWS.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>就可以了。



【志奇林峰】

职务:普通成员
等级:1
金币:0.1
发贴:99
#32006/4/25 21:05:11
I KNOW ~



yiliaocheng

职务:普通成员
等级:2
金币:2.0
发贴:631
#42006/4/25 21:08:07
nmzhilin不要回灌水帖好不?