怎样才能使菜单项通过后台数据库中的字段值控制显示啊?:(MM): 你可以参照一下有关select地三级联动地例子,原理是相同地。这个只是取出数组,组成菜单地代码暂时没有。呵呵 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 访问服务端的语言要求用的是jsp啊!菜单部分可否用js做呀?select三级联动是什么呀?555... jsp当然可以做select的项目根据服务段数据库中记录集而定,生成到客户端,三级联动可以用js实现具体的,翻个旧帖给你,http://expert.csdn.net/Expert/topic/723/723099.xml?temp=.2613031,自己领会吧 大概我已经知道怎么做了!但,那么在jsp中的变量的值,如何传送给js的变量使用呢?可以通用全局变量吗? 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,jset rs=server.createobject("adodb.recordset")set rssub=server.createobject("adodb.recordset")sql="select distinct(sqdw) from tdsqdw"rs.open sql,conn,1,1if rs.eof and rs.bof thenelse 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> 怎么把简单的问题高复杂了呢!!就用ASp 不就够了 这位妹妹回去看一下关于ASP的书 很快就知道怎么做了另外问一下:谁有 用 RemoteScriptting作的多级动态select的例子 如果有Delphi或者Powerbuilder的经验,可以作cgi获得数据,再通过JavaScript以菜单的形式显示出来 如何用js修改一个自定义的标签的属性值 JSP乱码问题 新手求助一个getElementsByTagName 问题! 下拉菜单 请教浏览器中直接打开office文档 IE8下解析JSON对象导致无法输入汉字 请教脚本问题??谢谢 提交表单后如何用javascript得到文本框里的值,用request吗 使用javascript能控制扫描仪吗?? 已知年和月,如何得到该月有多少天?? 请求网上javascript教程,或者好的关于javascript的网站!! 一个windows media player全屏问题,急!
555...
select的项目根据服务段数据库中记录集而定,生成到客户端,三级联动可以用js实现
具体的,翻个旧帖给你,http://expert.csdn.net/Expert/topic/723/723099.xml?temp=.2613031,自己领会吧
但,那么在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>
就用ASp 不就够了 这位妹妹回去看一下关于ASP的书 很快就知道怎么做了
另外问一下:
谁有 用 RemoteScriptting作的多级动态select的例子