www.gusucode.com > ASP+ACCESS在线人才招聘网(源代码+论文) > ASP+ACCESS在线人才招聘网(源代码+论文)\inc\trade.asp

    <!--#include file="../inc/conn.asp"-->
<script>
function changeselect()
{
var num=document.fm1.gtype_search.options[fm1.gtype_search.selectedIndex].value;
switch (num)
{
<%main_id=0
  i=0
  sql="select * from trade_sub order by main_id"
  Set Rst=Server.CreateObject("Adodb.recordSet")
  Rst.Open sql,conn,1,1
  While Not Rst.Eof%>
<%if main_id<>Rst("main_id") then%>
case "<%=Rst("main_id")%>" :
<%sqlt="select count(*) as count from trade_sub where main_id="& Rst("main_id")
  Set Rrs=conn.execute(sqlt)%>
document.fm1.gsubtype_search.options.length=<%=Rrs("count")%>;
<%End If%>
document.fm1.gsubtype_search.options[<%=i%>].text='<%=Rst("sub_name")%>'
document.fm1.gsubtype_search.options[<%=i%>].value=<%=Rst("sub_id")%>;
<%
main_id=Rst("main_id")
Rst.MoveNext
if not Rst.Eof then
  if main_id<>Rst("main_id") then%>
     break;
   <%
    i=0
   else 
    i=i+1
   end If
end if
Wend
Rst.Close%>
break;
default:
document.fm1.gsubtype_search.options.length=1;
document.fm1.gsubtype_search.options[0].text='没有子分类'
document.fm1.gsubtype_search.options[0].value=0;
break;
} 
}
 </script>
  行业一级分类 
  <select name='gtype_search' onChange="javascript:changeselect()" class="imgClass">
 <option value='0' selected>选择分类</option>
<%sql="select * from trade_main order by main_id"
  Rst.Open sql,conn,1,1
  while Not Rst.Eof%>
<option value='<%=Rst("main_id")%>'><%=Rst("main_name")%></option>
<%Rst.Movenext
  Wend
  Rst.close%>
</select><br><br>
  行业二级分类
   <select name='gsubtype_search' class="imgClass">
<option value='0' selected>选择子分类</option>
</select>
<html></html>