大家帮帮忙 谢谢 先
wxfcj 2004-05-04 07:41:31 我是个初学者
现在做了一个2级 的下拉菜单
函数:<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from city order by city_id asc" city 是一个表
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("city_name"))%>","<%= trim(rs("prov_id"))%>","<%= trim(rs("city_id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation1(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
在下面调用时是好用的
但是我这个页面同时调用了一个页面那个页面中也有类似的函数,结果两个2级的下啦菜单都不好用 把一个去掉 另一个就正常了。
能不能帮我一下
谢谢