标题:[求助]帮我看看这段代码
只看楼主
xiaoyao97106
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2004-9-27
 问题点数:0 回复次数:5 
[求助]帮我看看这段代码

<% openconn createrec objrec.source="Select * from pline where pior='99' and pid='4'order by code" objrec.open %> <script language = "JavaScript"> <!-- var onecount=0; subcat=new array(); <% count=0 do while not objrec.eof %> subcat[<%=count%>]=new array("<%=trim(objrec("pLinename"))%>"); <%count=count+1 objrec.movenext loop objrec.close set objrec=nothing %> onecount=<%=count%>

function setField(source,target,tiao,chanshu) { //alert(source.options(source.selectedIndex).value); if (source.options(source.selectedIndex).value=="LCD") { document.all("text1").style.display ="none"; var oOption = document.createElement('OPTION'); target.options.length = 0; oOption.text = "8字"; oOption.value = "8字"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "字符"; oOption.value = "字符"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "点阵"; oOption.value = "点阵"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "其他"; oOption.value = "其他"; target.options.add(oOption);

} if (source.options(source.selectedIndex).value=="LCM") { document.all("text1").style.display =""; target.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text = "外形尺寸"; oOption.value = "psize"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "工艺"; oOption.value = "gongyi"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "点阵尺寸"; oOption.value = "showsize"; target.options.add(oOption); } if (source.options(source.selectedIndex).value=="LCM") { tiao.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text = "图形型"; oOption.value = "图形型"; tiao.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "字符型"; oOption.value = "字符型"; tiao.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "段码型"; oOption.value = "段码型"; tiao.options.add(oOption); } if (source.options(source.selectedIndex).value=="LCD") { tiao.options.length = 0; for (k=1; k<onecount;k++) bigclass ="&subcat[k]&"; var oOption = document.createElement('OPTION'); oOption.text = bigclass; oOption.value = bigclass; tiao.options.add(oOption); } }

//--> </script>

搜索更多相关主题的帖子: 代码 
2004-09-29 15:08
寒星
Rank: 1
等 级:新手上路
帖 子:455
专家分:0
注 册:2004-6-7
得分:0 

拜托!

什么错误也不说,什么问题也没有,让别人怎么看啊?

拜托楼主体问题的时候换个方式。


http://www. 版主位置空缺
2004-09-29 16:19
xiaoyao97106
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2004-9-27
得分:0 

<script language = "JavaScript"> <!-- function setField(source,target,tiao,chanshu) { //alert(source.options(source.selectedIndex).value); if (source.options(source.selectedIndex).value=="LCD") { document.all("text1").style.display ="none"; var oOption = document.createElement('OPTION'); target.options.length = 0; oOption.text = "8字"; oOption.value = "8字"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "字符"; oOption.value = "字符"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "点阵"; oOption.value = "点阵"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "其他"; oOption.value = "其他"; target.options.add(oOption);

} if (source.options(source.selectedIndex).value=="LCM") { document.all("text1").style.display =""; target.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text = "外形尺寸"; oOption.value = "psize"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "工艺"; oOption.value = "gongyi"; target.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "点阵尺寸"; oOption.value = "showsize"; target.options.add(oOption); } if (source.options(source.selectedIndex).value=="LCM") { tiao.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text = "图形型"; oOption.value = "图形型"; tiao.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "字符型"; oOption.value = "字符型"; tiao.options.add(oOption); var oOption = document.createElement('OPTION'); oOption.text = "段码型"; oOption.value = "段码型"; tiao.options.add(oOption); } <% openconn createrec objrec.source="Select * from pline where pior='99' and pid='4'" objrec.open aa=objrec.recordcount if not objrec.eof then %>

if (source.options(source.selectedIndex).value=="LCD") { tiao.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text ="<%=objrec("pLinename")%>"; oOption.value ="<%=objrec("pLinename")%>"; tiao.options.add(oOption); } <% objrec.movenext end if objrec.close %>

}

//--> </script>

问题出在后边,我想让

if (source.options(source.selectedIndex).value=="LCD") { tiao.options.length = 0; var oOption = document.createElement('OPTION'); oOption.text ="<%=objrec("pLinename")%>"; oOption.value ="<%=objrec("pLinename")%>"; tiao.options.add(oOption); } 这部分循环显示objrec("pLinename")的内容,但是出来的只有一个

2004-09-29 16:24
寒星
Rank: 1
等 级:新手上路
帖 子:455
专家分:0
注 册:2004-6-7
得分:0 
你哪有写循环?

http://www. 版主位置空缺
2004-09-29 16:36
xiaoyao97106
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2004-9-27
得分:0 

我加了循环什么都不显示亚?

2004-09-29 17:33
yl10
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2004-9-30
得分:0 

莫名其妙,


我是老大,我怕谁。 www. 西联技术人才群:22238869
2004-09-30 06:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-5863-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.062691 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved