sub ShowSearch(ShowType)
dim count
if ShowType<>1 and ShowType<>2 then
ShowType=1
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<table border="0" cellpadding="2" cellspacing="0" align="center">
<form method="Get" name="myform" action="search.asp">
<tr><td height="28">
<select name="Field" size="1">
<option value="Title" selected>产品名称</option>
<option value="Content">产品说明</option>
</select>
<%if ShowType=1 then%>
</td><td height="28">
<%end if%>
<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="">所有大类</option>
<%
if not (rsBigClass.bof and rsBigClass.eof) then
rsBigClass.movefirst
do while not rsBigClass.eof
response.Write "<option value='" & trim(rsBigClass("BigClassName")) & "'>" & trim(rsBigClass("BigClassName")) & "</option>"
rsBigClass.movenext
loop
end if
%>
</select>
<%if ShowType=1 then%>
</td><td height="28">
<%end if%>
<select name="SmallClassName">
<option selected value="">所有小类</option>
</select>
<%if ShowType=1 then%>
</td><td height="28">
<%end if%>
<input type="text" name="keyword" size=15 value="关键字" maxlength="50" onFocus="this.select();">
<input type="submit" name="Submit" value="搜索">
</td></tr>
</form>
</table>
5 个解决方案
#1
高手看下,帮忙,先谢!
#2
换个问法,分类三级,哪位有经验给指点下,最好把代码借我看下,我现在只有二级分类的,不知道再往下分应该注意什么,高手帮下!
#3
帮你顶下先~
#4
up
#5
分类的贴子我找了一下,可要不就是没代码,要不就是代码我看不懂的,我想问问,有没有高手会做大类分下小类后,可以显示小类下的动态下拉框里再显示对应的某个字段的???不知高手明白没,帮下
#1
高手看下,帮忙,先谢!
#2
换个问法,分类三级,哪位有经验给指点下,最好把代码借我看下,我现在只有二级分类的,不知道再往下分应该注意什么,高手帮下!
#3
帮你顶下先~
#4
up
#5
分类的贴子我找了一下,可要不就是没代码,要不就是代码我看不懂的,我想问问,有没有高手会做大类分下小类后,可以显示小类下的动态下拉框里再显示对应的某个字段的???不知高手明白没,帮下