你可以参照一下有关select地三级联动地例子,原理是相同地。
这个只是取出数组,组成菜单地代码暂时没有。呵呵

解决方案 »

  1.   

    访问服务端的语言要求用的是jsp啊!菜单部分可否用js做呀?select三级联动是什么呀?
    555...
      

  2.   

    jsp当然可以做
    select的项目根据服务段数据库中记录集而定,生成到客户端,三级联动可以用js实现
    具体的,翻个旧帖给你,http://expert.csdn.net/Expert/topic/723/723099.xml?temp=.2613031,自己领会吧
      

  3.   

    大概我已经知道怎么做了!
    但,那么在jsp中的变量的值,如何传送给js的变量使用呢?可以通用全局变量吗?
      

  4.   

    jsp中动态生成客户端多维数组,然后在客户端用js来控制多个下拉列表框的关联
    服务端的变量不可以与客户端共享
    给个asp的做法,参考吧
    http://expert.csdn.net/Expert/topic/1848/1848825.xmlbase.asp中是数据库连接允许多选,当然你也可以把它改成单选
    <%@language=vbscript%>
    <%option explicit%>
    <!--#include file="base.asp"-->
    <body>
    choose department: 
    <select name=department multiple onchange=mysel()>
    </select>
    person:
    <select name=person>
    </select>
    <script>
    var persons=new Array();
    <%
    dim rs,rssub,sql,sqlsub,i,j
    set rs=server.createobject("adodb.recordset")
    set rssub=server.createobject("adodb.recordset")sql="select distinct(sqdw) from tdsqdw"
    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
    else
    i=0
    %>
    document.all.department.options.length=0;
    <%
    while not rs.eof
    %>
    persons[<%=i%>]=new Array();
    document.all.department.options.length++;
    document.all.department.options[document.all.department.options.length-1].value="<%=rs("sqdw")%>";
    document.all.department.options[document.all.department.options.length-1].text="<%=rs("sqdw")%>";
    <%
    sqlsub="select distinct(sqr) from tdsqdw where sqdw='"+rs("sqdw")+"'"
    rssub.open sqlsub,conn,1,1
    if rssub.eof and rssub.bof then
    else  
    j=0   
    while not rssub.eof
    %>
    persons[<%=i%>][<%=j%>]="<%=rssub("sqr")%>";
    <%
    rssub.movenext
    j=j+1
    wend
    end if
    rssub.close
    rs.movenext
    i=i+1
    wend
    %>
    document.all.department.size=document.all.department.options.length;
    <%
    end ifrs.close
    %>
    function mysel()
    {
    document.all.person.options.length=0;
    for(i=0;i<document.all.department.options.length;i++)
    {
    if(document.all.department.options[i].selected)
    {
    for(j=0;j<persons[i].length;j++)
    {
    document.all.person.options.length++;
    document.all.person.options[document.all.person.options.length-1].value=persons[i][j];
    document.all.person.options[document.all.person.options.length-1].text=persons[i][j];
    }
    }
    }
    }
    function initsel()
    {
    document.all.department.options[0].selected=true;
    for(i=0;i<persons[0].length;i++)
    {
    document.all.person.options.length++;
    document.all.person.options[document.all.person.options.length-1].value=persons[0][i];
    document.all.person.options[document.all.person.options.length-1].text=persons[0][i];
    }
    }
    initsel();
    </script>
      

  5.   

    怎么把简单的问题高复杂了呢!!
    就用ASp  不就够了  这位妹妹回去看一下关于ASP的书  很快就知道怎么做了
    另外问一下:
    谁有  用 RemoteScriptting作的多级动态select的例子
      

  6.   

    如果有Delphi或者Powerbuilder的经验,可以作cgi获得数据,再通过JavaScript以菜单的形式显示出来