一个asp二级联动问题

lizhou1228 2009-07-14 04:16:40
我是代码截选=======================================
<%dim sid,sname,paixu
sname=request.QueryString("picname")
sid=request.QueryString("id")
%>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from sindex where txt=1 ",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("sname"))%>","<%= rs("mid")%>","<%= rs("sid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>

onecount=<%=count%>;

function changelocation(locationid)
{
document.addinfo.sidc.length = 0;

var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.addinfo.sidc.options[document.addinfo.sidc.length] = new Option(subcat[i][0], subcat[i][2]);
}
}

}
</script>

============================select.mid(大类id 即mid选择)
<tr><form name="addinfo">
<td height="26">
<%
rs.open "select * from mindex where tet=1",conn,1,1
if rs.eof and rs.bof then
response.write "还没有大类"
response.end
else
%>
<select name="midc" size="1" id="midc" onChange="changelocation(document.addinfo.midc.options[document.addinfo.midc.selectedIndex].value)" style="width:110;">
<option selected value="<%=rs("mid")%>"><%=trim(rs("mname"))%></option>
<%
dim selclass
selclass=rs("mid")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("mid")%>"><%=trim(rs("mname"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
===================select.sid(小类id 即sid选择)=========================================
<select name="sidc" style="width:140;" class="indextime" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}">
<%
rs.open "select * from sindex where mid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option value="txt.asp?id=<%=rs("sid")%>" <%if rs("sid")=cint(request.QueryString("id")) then %>selected<%end if%>><%=trim(rs("sname"))%></option>
<%
rs.movenext
do while not rs.eof
%>
========================将sid作为查询参数传给显示页面==================================
<option value="txt.asp?id=<%=rs("sid")%>" <%if rs("sid")=cint(request.QueryString("id")) then %>selected<%end if%>><%=trim(rs("sname"))%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>

</td></form>
</tr>


关系图:

选择大类 选择小类

select.mdi-01(=)select.sid-01
(=)select.sid-02

select.mdi-02(=)select.sid-01
(=)select.sid-02
....

select.mdi-n(=)select.sid-01
(=)select.sid-02


问题:除第一个
select.mdi-01(=)select.sid-01
(=)select.sid-02
能将sid正常传给显示页面外,其他的都只能将sid取出来,但是传不到指定页面
正常传递:http://localhost/cax2/admin/txt.asp?id=4
不正常 :http://localhost/cax2/admin/4
...全文
111 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧