看看AJAX的资料,很快就能搞定

解决方案 »

  1.   

    要求asp.net ,谁能给段代码吗?分不够可以再加。
      

  2.   

    可以div 
    初始化 隐藏点击时显示
      

  3.   

    思路可以给,代码要自己写。可以存储到数组中,可以放到数据库中用iframe或者xmlhttp调用,显示当然用层,最好嵌套一个页面可以挡住select
      

  4.   

    http://www.cnithr.com/personal/job_search.php 这个也有选择城市的js代码
      

  5.   

    <%
    end sub
    sub b()
    ShowType=2   '该参数确定横向还是纵向排列
    sqlBigClass="select * from BigClass order by BigClassID"  '
    Set rsBigClass= Server.CreateObject("ADODB.Recordset")
    rsBigClass.open sqlBigClass,conn,1,1dim 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="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>
        </tr>
        <tr>
          <td height="28"> 
            <%end if%>
            <select name="SmallClassName">
              <option selected value="">所有小类</option>
            </select> 
            <%if ShowType=1 then%>
          </td>
        </tr>
        <tr>
          <td height="28"> 
            <%end if%>
            <input type="text" name="keyword"  size=12 value="关键字" maxlength="50" onFocus="this.select();"> 
            <input type="submit" name="Submit"  value="搜索"> </td>
        </tr>
      </form>
    </table>
    <%
    end sub
    %>