asp分类出错了
本来大类的改变,小类也应该变的,可是不知道是怎么会事,怎么不对了,希望大家能帮帮我。http://www.xiang8.com/boardsearch.asp?key=影...
本来大类的改变,小类也应该变的,可是不知道是怎么会事,怎么不对了,希望大家能帮帮我。
http://www.xiang8.com/boardsearch.asp?key=影视
部分代码:
<SCRIPT language="javascript">
function changelocation(locationid)
{
document.form.BoardClass.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form.BoardClass.options[document.form.BoardClass.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT>
...
<TD width="10%" height="30" align="left" class=INDEX_XMALL>所属大类:</td>
<TD height="30" colspan="2">
<SELECT name="BoardNlass" onChange="changelocation(document.form.BoardNlass.options[document.form.BoardNlass.selectedIndex].value)" size="1">
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from QiQiBoy_Nlass_Disp"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "..."
response.end
else
%>
<OPTION selected value>==请选择大类==</OPTION>
<%do while not rs.eof%>
<OPTION value="<%=trim(rs("BoardNlass"))%>"><%=trim(rs("BoardNlassName"))%></OPTION>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%></SELECT>
</TD>
<TD width="0%" height="30"></TD></TR>
<TR>
<TD width="8%" height="30"></TD>
<TD width="10%" height="30" align="left" class=INDEX_XMALL>所属小类:</td>
<TD height="30" colspan="2"><SELECT name="BoardClass"><OPTION selected value>==请选择小类==</OPTION></SELECT></TD>
<TD width="0%" height="30"></TD></TR>
<TR> 展开
http://www.xiang8.com/boardsearch.asp?key=影视
部分代码:
<SCRIPT language="javascript">
function changelocation(locationid)
{
document.form.BoardClass.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form.BoardClass.options[document.form.BoardClass.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT>
...
<TD width="10%" height="30" align="left" class=INDEX_XMALL>所属大类:</td>
<TD height="30" colspan="2">
<SELECT name="BoardNlass" onChange="changelocation(document.form.BoardNlass.options[document.form.BoardNlass.selectedIndex].value)" size="1">
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from QiQiBoy_Nlass_Disp"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "..."
response.end
else
%>
<OPTION selected value>==请选择大类==</OPTION>
<%do while not rs.eof%>
<OPTION value="<%=trim(rs("BoardNlass"))%>"><%=trim(rs("BoardNlassName"))%></OPTION>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%></SELECT>
</TD>
<TD width="0%" height="30"></TD></TR>
<TR>
<TD width="8%" height="30"></TD>
<TD width="10%" height="30" align="left" class=INDEX_XMALL>所属小类:</td>
<TD height="30" colspan="2"><SELECT name="BoardClass"><OPTION selected value>==请选择小类==</OPTION></SELECT></TD>
<TD width="0%" height="30"></TD></TR>
<TR> 展开
1个回答
展开全部
你的subcat没有定义
格式应该是
<script language = "JavaScript">
var onecount;
subcat = new Array();
subcat[0] = new Array("公司简介","关于我们","公司简介");
subcat[1] = new Array("珠宝文化","珠宝文化","珠宝文化");
subcat[2] = new Array("联系我们","关于我们","联系我们");
subcat[3] = new Array("会员活动","会员专区","会员活动");
subcat[4] = new Array("新闻中心","新闻中心","新闻中心");
subcat[5] = new Array("连锁加盟","关于我们","连锁加盟");
onecount=6;
格式应该是
<script language = "JavaScript">
var onecount;
subcat = new Array();
subcat[0] = new Array("公司简介","关于我们","公司简介");
subcat[1] = new Array("珠宝文化","珠宝文化","珠宝文化");
subcat[2] = new Array("联系我们","关于我们","联系我们");
subcat[3] = new Array("会员活动","会员专区","会员活动");
subcat[4] = new Array("新闻中心","新闻中心","新闻中心");
subcat[5] = new Array("连锁加盟","关于我们","连锁加盟");
onecount=6;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询