产品大类别:
<select name="bigtype" onChange="javascript:populateType1(document.form2,document.form2.bigtype);" style="width:150px" class="select"> <option selected value='' selected>选择大类别</option>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from type where (level=0 and typecode like '10%')"
rs.open sql,conn,1,1
temp=1
do while not rs.eof
response.write "<option value=A"+cstr(temp)+">"+rs("type1")+"</option>"
temp=temp+1
rs.movenext
loop
rs.close
set rs=nothing
%> </select>
</td>
</tr></tbody>
<tbody><tr>
<td width="12%"></td>
<td>产品小类别:
<select name="smalltype" class="select"> <option selected value='' selected>选择小类别</option> </select>
</td>
</tr></tbody>
</tbody>
</table>
</center>
</div>
</td>
</tr></tbody>
<tr align="right">
<td width=375 colspan=2 height=22>
<p align=center>
<input type=submit value=" 查 询 " ><INPUT TYPE="hidden" name=action value="search">
<br>
</p>
</td>
页面要包含makeselect.asp文件
<%
set rs=server.createobject("adodb.recordset")
sql="select * from type where (level=0 and typecode like '10%')"
rs.open sql,conn,1,1
response.write "<SCRIPT LANGUAGE=JavaScript>"+chr(13)+chr(10)
temp=1
response.write "var Array1 = new Array("+chr(34)+"('"+"选择大类别"+"')"+chr(34)+");"+chr(10)
response.write "var ArrayB1 = new Array("+chr(34)+"('"+"选择小类别"+"')"+chr(34)+");"+chr(10)
do while not rs.eof
code=left(rs("typecode"),4)
set rs1=server.createobject("adodb.recordset")
sql1="select * from type where (level=1 and typecode like '"+code+"%')"
rs1.open sql1,conn,1,1
stra= ""
strb= ""
stra=stra+"var A"+cstr(temp)+"Array1 = new Array("+chr(34)+"('"+rs("type1")+"')"+chr(34)
strb=strb+"var A"+cstr(temp)+"ArrayB1 = new Array("+chr(34)+"('"+cstr(rs("typecode"))+"')"+chr(34)
do while not rs1.eof
stra=stra+ ","+chr(34)+"('"+rs1("type2")+"')"+chr(34)
strb=strb+ ","+chr(34)+"('"+cstr(rs1("typecode"))+"')"+chr(34)
rs1.movenext
loop
stra=stra+");"
strb =strb+ ");"
response.write stra+chr(10)
response.write strb+chr(10)
temp=temp+1
rs.movenext
loop
rs.close
'rs1.close
response.write "</SCRIPT>"
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
function populateType1(inForm,selected)
<div id="menu" style="display:none">dfsdflhfsd</div>
脚本:
sub topmenu_onmouseover'就是鼠标移动到菜单上的事件,也可能是onmouseon
menu.style.display="inline" '显示子菜单。
end sub
sub topmenu_onmouseout'就是鼠标移开的事件
menu.style.display="none" '隐藏子菜单。
end sub