30分求助,实现,如图效果.在线等待。。。。。。。

ptyt 2003-12-28 05:12:09
品牌车型搜索,中,选择不同车型,在第二个下拉列表中实现,动态增加项。

http://auto.sina.com.cn/photo/chengduautoshow_model/index.shtml
...全文
42 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
tomelir 2003-12-29
  • 打赏
  • 举报
回复
很感谢CSDN
一般要解决的问题都可以上面找到答案
hfwpq 2003-12-29
  • 打赏
  • 举报
回复
以上一个通过年月得到案卷号,然后通过案卷号又能得到文件编号的例子。有兴趣的话看看吧
后面三个sel(*)change()就是放在onchange事件里的
hfwpq 2003-12-29
  • 打赏
  • 举报
回复
function createSuboptions()

{

var sMenu=document.Adjust.files_mark;
var fMenu=document.Adjust.new_files_mark;
var file=new Array();
var code=new Array();

<%
num=0
set rsdoc=server.createobject("adodb.recordset")
selectdoc="select * from "&tablename
rsdoc.open selectdoc,conn,1,1

while not rsdoc.eof
%>
if (<%=file_kind%>=='03'){

file[<%=num%>]="<%=rsdoc("file_mark")%>"

}else{

file[<%=num%>]="<%=rsdoc("files_mark")%>";

}
code[<%=num%>]="<%=rsdoc("file_year")%>";


<%
num=num+1
rsdoc.movenext
wend
%>

for (var i=0;i<<%=num%>;i++)
{
if (document.Adjust.file_year.value==code[i]) {


sMenu.options[i]=new Option(file[i],file[i]);
fMenu.options[i]=new Option(file[i],file[i]);

}
}

}

function createSub2Options()

{
var tMenu=document.Adjust.old_list;
var mark=new Array();
var doc_no=new Array();
var doc=new Array();
var j=0;

<%
count=0
set rsfile=server.createobject("adodb.recordset")
selectfile="select * from d_doc where doc_no<>'' and doc_no is not null and file_mark<>'' and file_mark is not null order by doc_no "
rsfile.open selectfile,conn,1,1
while not rsfile.eof
%>
mark[<%=count%>]="<%=rsfile("file_mark")%>";
doc_no[<%=count%>]="<%=rsfile("doc_no")%>";

<%
count=count+1
rsfile.movenext
wend
%>
for(var i=0;i<<%=count%>;i++)
{
if (document.Adjust.files_mark.value ==mark[i]){

doc[j]=doc_no[i];
j++;
}
}

for (var n=0;n<j;n++)
{
var m=n+1;

tMenu.options[n] = new Option(" "+m+" --------- "+doc[n],doc[n]);

}
}



function createSub3Options()

{
var tMenu=document.Adjust.new_list;
var mark=new Array();
var doc_no=new Array();
var doc=new Array();
var j=0;

<%
count=0
set rsfile=server.createobject("adodb.recordset")
selectfile="select * from d_doc where doc_no<>'' and doc_no is not null and file_mark<>'' and file_mark is not null order by doc_no "
rsfile.open selectfile,conn,1,1
while not rsfile.eof
%>
mark[<%=count%>]="<%=rsfile("file_mark")%>";
doc_no[<%=count%>]="<%=rsfile("doc_no")%>";

<%
count=count+1
rsfile.movenext
wend
%>
for(var i=0;i<<%=count%>;i++)
{
if (document.Adjust.new_files_mark.value ==mark[i]){

doc[j]=doc_no[i];
j++;
}
}

for (var n=0;n<j;n++)
{
var m=n+1;

tMenu.options[n] = new Option(" "+m+" --------- "+doc[n],doc[n]);

}
}

function sel1change()

{ delAll('document.Adjust.files_mark');
createSuboptions();
createSub2Options();
}

function sel2change()

{
delAll('document.Adjust.old_list');
createSub2Options();

}

function sel3change()

{
delAll('document.Adjust.new_list');
createSub3Options();

}
hfwpq 2003-12-29
  • 打赏
  • 举报
回复
搜索一下联动,阿信有一个三级联动的例子。
cep50 2003-12-28
  • 打赏
  • 举报
回复
up
Lowjim 2003-12-28
  • 打赏
  • 举报
回复
当你第一个下拉列表框改变时,重新加载页面,把第一个下拉列表框的参数传到服务器,进行查询,再把查询结果写进第二个下拉列表框。
minghui000 2003-12-28
  • 打赏
  • 举报
回复
分少了点
新手学习着呢 2003-12-28
  • 打赏
  • 举报
回复

还没有解决吗?找我,嘿嘿

134127~~~~~~~~QQQQQQQQQQQQQQQQQQQQQQ
ptyt 2003-12-28
  • 打赏
  • 举报
回复
可是,我现在的问题在,两个下拉列表,都是在数据库里取出来的。
第一个改变的时候,第二个也进行检索后改变(它是从数据库里取)。
求助ing .........................
shdcxue 2003-12-28
  • 打赏
  • 举报
回复
<!--[33,175,1] published at 2003-12-26 11:23:21 from #010 by 265-->
//汽车品牌及型号数组定义
//格式:carTypes[序号]=new Array('品牌', '型号1','型号1 url', '型号2','型号2 url', ...)
carTypes=new Array()
carTypes[0]=new Array('NISSAN','ZN1031U2G','http://auto.sina.com.cn/salon/hn-nissan/hn-nissan/zhengzhourichan-ZN1031U2G/car.shtml','ZN5031XGCE2G','http://auto.sina.com.cn/salon/hn-nissan/hn-nissan/zhengzhourichan/car.shtml','帕拉丁SE 4X4(4WD)','http://auto.sina.com.cn/salon/hn-nissan/hn-nissan/PALADIN3.3L/car.shtml','帕拉丁XE 4X2(2WD)','http://auto.sina.com.cn/salon/hn-nissan/hn-nissan/ZN6491E2G/car.shtml','帕拉丁XE 4X4(4WD)','http://auto.sina.com.cn/salon/hn-nissan/hn-nissan/PALADIN/car.shtml')
carTypes[1]=new Array('Scion','Scion xA','http://auto.sina.com.cn/salon/TOYOTA/Scion/xA/car.shtml','Scion xB','http://auto.sina.com.cn/salon/TOYOTA/Scion/xB/car.shtml')
carTypes[2]=new Array('阿尔法.罗米欧','阿尔法-罗米欧166','http://auto.sina.com.cn/salon/FIAT/ALFAROMEO/Alfa-romeo_166/car.shtml','阿尔法-罗米欧Gtv','http://auto.sina.com.cn/salon/FIAT/ALFAROMEO/Alfa_Gtv/car.shtml','阿尔法.罗米欧147','http://auto.sina.com.cn/salon/FIAT/ALFAROMEO/Alfa-romeo147/car.shtml','阿尔法.罗米欧156','http://auto.sina.com.cn/salon/FIAT/ALFAROMEO/Alfa-romeo_156/car.shtml')
carTypes[3]=new Array('阿斯顿·马丁','阿斯顿.马丁DB7','http://auto.sina.com.cn/salon/FORD/ASTONMARTIN/martin_DB7/car.shtml','阿斯顿马丁_优势','http://auto.sina.com.cn/salon/FORD/ASTONMARTIN/youshi/car.shtml')
carTypes[4]=new Array('奥迪','新奥迪A8','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/xinaudiA8/car.shtml','奥迪 A4 敞篷版','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/audia4cabrio/car.shtml','奥迪 allroad quattro','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/allroad/car.shtml','奥迪 S4 敞篷版','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/audis4cabio/car.shtml','奥迪A2','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/AudiA2/car.shtml','奥迪A3','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/Audi_A3/car.shtml','奥迪A4','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/A41.8/car.shtml','奥迪A61.8','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/A61.8/car.shtml','奥迪A62.4','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/A62.4/car.shtml','奥迪A62.8','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/A62.8/car.shtml','奥迪A8','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/AUDI_A8/car.shtml','奥迪A8_2.8','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/A8_2.8/car.shtml','奥迪Quattro','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/AUDIQuattro/car.shtml','奥迪S4','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/AUDI_S4/car.shtml','奥迪TT','http://auto.sina.com.cn/salon/VOLKSWAGEN/AUDI/AUDI_TT/car.shtml')
function setType(form,obj){
if ( obj.selectedIndex >0 ){
var brandIndex=obj.selectedIndex-1;
form.carType.options.length=0 //clear carType selector
form.carType.options[0]=new Option('请选择型号  ')
for (i=1;i<carTypes[brandIndex].length/2;i++){
form.carType.options[i]=new Option(carTypes[brandIndex][i*2-1],carTypes[brandIndex][i*2])
}
}

}

function openNewWin(form){
if (form.carType.selectedIndex>0){
var url=form.carType[form.carType.selectedIndex].value
window.open(url)
}else{
alert("请选择!")
}
}
possible_Y 2003-12-28
  • 打赏
  • 举报
回复
搜索“联动”
swell624 2003-12-28
  • 打赏
  • 举报
回复
可以为第一个下拉列表的onchang事件编写程序,通过onchange事件判断选择的项目,再改变第二个下拉列表的内容。

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧