asp 二级联动搜索
<script type="text/javascript">
var subval2 = new Array(); //这里定义一个数组
<%
set ClassRs=server.CreateObject("adodb.recordset")
ClassSql="select * from xinghao"
ClassRs.open ClassSql,conn,1,3
if ClassRs.eof and ClassRs.bof then
Response.Write("暂无信息")
else
count=0'定义数组的下标
do while not ClassRs.eof
%>
subval2[<%=count%>] = new Array('<%=ClassRs("pinpaiid")%>','<%=ClassRs("xinghaoid")%>','<%=ClassRs("xinghao")%>');
<%
count=count+1
ClassRs.movenext
loop
ClassRs.close
set ClassRs=nothing
end if
%>
function ClassChange(locationid)
{
document.form1.SelectClass.length = 0;
document.form1.SelectClass.options[0] = new Option('选择机型','');//如果想直接选中第一个则注释此句。
for (i=0; i<subval2.length; i++)
{
if (subval2[i][0] == locationid)
{
document.form1.SelectClass.options[document.form1.SelectClass.length] = new Option(subval2[i]
[2],subval2[i][1]);
}
}
}
</script>
<div id="main05">请选择适合的品牌 >></div>
<div class="pp"><img src="img/pp.jpg" alt="选择品牌"/><br /><br />
<form name="form1" action="a.asp" method="post"><!--表单开始-->
<%
set ItemRs=server.CreateObject("adodb.recordset")
'ItemSql="select BCity.BCityId BCityName from BCity where BCity.BCityId in (select SCity.SCityId from SCity where BCity.BcityId=SCity.BCityId) "
'ItemSql="SELECT BCity.BcityId, SCity.BCityId, BCityName,having count(SCityName)=1 FROM BCity INNER JOIN SCity ON BCity.BcityId=SCity.BCityId"
ItemSql="SELECT * FROM pinpai"
ItemRs.open ItemSql,conn,1,3
if ItemRs.eof and ItemRs.bof then
Response.Write("暂无信息")
else
Response.Write("<select name=""SelectItem"" onChange=""ClassChange(this.value)"" style=""width:80px;"">")
Response.Write("<option value=""0"" selected>手机品牌</option>")
do while not ItemRs.eof
%>
<option value="<%=ItemRs("pinpaiid")%>"><%=ItemRs("pinpai")%></option>
<%
ItemRs.movenext
loop
Response.Write("</select>")
ItemRs.close
set ItemRs=nothing
end if
%>
<select name="SelectClass" tabindex="2">
<option>选择机型</option>
</select> <input type="button" value="搜索" tabindex="3" />
</form>
数据库db1.mdb 表名:pinpai(手机品牌)字段:pinpaiid pinpai ,
xinghao(手机型号)字段:xinghaoid xinghao pinpaiid
前面的二级联动可以从数据库中提取,就是按搜索按钮以后怎么跳转到其他页面并显示对应手机的型号
谢谢各位多帮帮忙,要详细一点的谢谢诶
追问:有一些明白,但怎么写呀,我第一次弄asp的,帮帮我好不又没有一些具体的代码示例