各位程序高手,再帮我看看这个问题吧,再次感谢了!!!
下面是两个下拉列表,我想把S1中的内容作为S2中SELECT 语句中的条件。就是S1是个大类,当选择了一个S1中的大类时,要从S2中列出S1中大类中的小类。该如何实现。谢谢谢谢!
<select name="s1">
<option value="0">顶级类</option>
<%
dim rootIDRs
dim tempName
dim i
set rootIDRs=server.createobject("adodb.recordset")
sql="select * from productSort where fatherID=0 order by id" '在productSort表中,fatherID是0表示是大类,该表就有三个字段项,ID,fatherID,name.
rootIDRs.open sql,conn,1,1
i=0
do while not (rootIDRs.eof or err)
tempName=rootIDRs("name")
response.write "<option value='"&rootIDRs("id")&"'>"&tempName&"</option>"
if i>100 then exit do
i=i+1
rootIDRs.movenext
loop
%>
</select>
<select name="s2">
<option value="0">子类</option>
<%
dim root
dim temp
dim j
set root=server.createobject("adodb.recordset")
sql="select * from productSort where ???????????????"
root.open sql,conn,1,1
j=0
do while not (root.eof or err)
temp=root("name")
response.write "<option value='"&root("id")&"'>"&temp&"</option>"
if i>100 then exit do
j=j+1
root.movenext
loop
%>
</select>