为什么我的二级联动菜单界面显示的界面是空白的呢??
源代码如下:
<!--#include file="Conn.asp"-->
<script language="javascript">
<%
dim sql,i,j
set rs_bmd=server.CreateObject("adodb.recordset")
sql="select *from bmd"
rs_bmd.open sql,conn,1,1
%>
var selects=[];
selects['xxx']=new array(new option('请选择','xxx'));
<%
for i=1 to rs_bmd.recordcount
%>
selects['<%=rs_bmd("id_no")%>']=new array(
<%
set rs_bmx=server.CreateObject("adodb.recordset")
sql="select * from bmx where bmd_id="&rs_bmd("id_no")&""
rs_bmx.open sql,conn,1,1
if re_bmx.recordcount>0 then
for j=1 to rs_bmx.recordcount
if j=rs_bmx.recordcount then
%>
new option('<%=trim(rs_bmx("bm_name"))%>','<%=trim(rs_bmx("id_no"))%>'));
<%else%>
new option('<%=trim(rs_bmx("bm_name"))%>','<%=trim(rs_bmx("id_no"))%>')),
<%
end if
rs_bmx.movenext
next
else
%>
new option('','0'));
<%
end if
rs_bmx.close
set rs_bmx=nothing
rs_bmd.movenext
next
rs_bmd.close
set rs_bmd=nothing
%>
function chsel(){
with (document.form1){
if(bmd_select.value){
bmx_select.options.length=0;
for(var i=0;i<selects[bmd_select.value].length;i++){
bmx_select.add(selects[bmd_select.value][i]);
}
}
}
}
</script>
<form name="form1" method="post" action="">
<select name="bmd_select" onChange=chsel()>
<option value="xxx">请选择</option>
<%
dim tmpid
set rs_bmd=server.CreateObject("adodb.recordset")
sql="select *from bmd"
rs_bmd.open sql,conn,1,1
while not rs_bmd.eof
tmpid=rs_bmd("id_no")
%>
<option value="<%=rs_bmd("id_no")%>"><%=trim(rs_bmd("bm_name"))%></option>
<%
rs_bmd.movenext
wend
rs_bmd.close
set rs_bmd=nothing
%>
</select>
<select name="bmx_select">
<%set rs_bmx=server.CreateObject("adodb.recordset")
sql="select * from bmx where bmd_id="&tmpid&""
rs_bmx.open sql,conn,1,1
while not rs_bmx.eof
%>
<option value="<%=rs_bmx("id_no")%>"><%=trim(rs_bmx("id_no"))%></option>
<%rs_bmx.movenext
wend
rs_bmx.close
set rs_bmx=nohing
%>
</select>
</form>
请帮助看一下好么....谢谢!!
在空白界面的源代码里有这么一段提示:
<script language="javascript">
var selects=[];
selects['xxx']=new array(new option('请选择','xxx'));
selects['1']=new array(
<font face="宋体" size=2>
<p>Microsoft JET Database Engine</font> <font face="宋体" size=2>错误 '80040e07'</font>
<p>
<font face="宋体" size=2>标准表达式中数据类型不匹配。</font>
<p>
<font face="宋体" size=2>/fenlei2.asp</font><font face="宋体" size=2>,行 18</font>
可是我找不出来到底是哪里不匹配哦.......
我的表是这么建立的:
表一、(bmd)
字段 类型
id_no 自动编号
bm_name 文本
表二、(bmx)
id_no 自动编号 备注
bmd_id 文本 这里是表一的id_no号
bm_name 文本
[此贴子已经被作者于2006-3-8 10:03:43编辑过]