| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 638 人关注过本帖
标题:急求一个JSP的三级联动
只看楼主 加入收藏
menzi_love
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-3-30
收藏
 问题点数:0 回复次数:4 
急求一个JSP的三级联动

谁有JSP的三级联动的源码呀?
我现在急用``
谢谢~!

搜索更多相关主题的帖子: JSP 
2007-06-16 11:51
menzi_love
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-3-30
收藏
得分:0 
我晕``
大虾们,快点给我一个源码好吗???
怎么没人理我呢???

JAVA
2007-06-16 12:07
独孤无痕
Rank: 1
等 级:新手上路
威 望:2
帖 子:159
专家分:0
注 册:2006-7-12
收藏
得分:0 
javascript来写

2007-06-16 13:17
野蛮女人
Rank: 5Rank: 5
等 级:贵宾
威 望:19
帖 子:827
专家分:0
注 册:2007-4-7
收藏
得分:0 
ajax

[shadow=255,purple,5]好人不长命,祸害一万年![/shadow]
2007-06-19 16:35
pilou5400
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-11-7
收藏
得分:0 

<script type="text/javascript">
var count = 0;
var count1 = 0;
var dataArray = new Array();
var dataArray1 = new Array();

function setpic(filepath){
//alert(filepath);
document.all.fileimg.src = filepath;
}


//把数组数据添加到select里面
function getCheckBox(){
for(var i=0; i<dataArray.length; i++){
document.all.father_classid.options[document.all.father_classid.length] =
new Option(dataArray[i][0],dataArray[i][1]);
}
}
//把数组数据添加到select1里面
function getCheckBox1(){
for(var i=0; i<dataArray1.length; i++){
document.all.child_classid.options[document.all.child_classid.length] =
new Option(dataArray1[i][0],dataArray1[i][1]);
}
}


//添加select数据
function getDataArray(classid, classname){
//alert(classid);
dataArray[count]=new Array(classid, classname);
count = count+1;
}
//添加select1数据
function getDataArray1(classid1, classname1){
//alert(classid1);
dataArray1[count1]=new Array(classid1, classname1);
count1 = count1+1;
}




//选择当前的select
function selectCheck(classid){
var length = document.all.father_classid.length;
for(var i=0; i<length; i++){
if(document.all.father_classid.options[i].value == classid){
document.all.father_classid.selectedIndex = i;
break;
}
}

}
//选择当前的select1
function selectCheck1(classid1){
var length = document.all.child_classid.length;
for(var i=0; i<length; i++){
if(document.all.child_classid.options[i].value == classid1){
document.all.child_classid.selectedIndex = i;
break;
}
}

}

//取出当前的大类的value值
function getValue(){
//alert(this.options[this.selectedIndex].value);
return document.all.father_classid.options[document.all.father_classid.selectedIndex].value;
}
//取出当前的小类的value值
function getValue1(){
//alert(this.options[this.selectedIndex].value);
return document.all.child_classid.options[document.all.child_classid.selectedIndex].value;
}

function setHiddenClass(){
document.all.classid.value = getValue();
document.all.nclassid.value = getValue1();
}

</script>

____________________________________________________________________

<tr>
<td>
&nbsp;大类分类
</td>
<td>&nbsp;
<c:forEach var="artClasses" items="${sessionScope.listArtClasses}">
<script>
getDataArray('${artClasses.classname }', '${artClasses.classid }');
</script>
</c:forEach>

<select name="father_classid" id="father_classid" style="width:120px;" onchange="location='ArtAction?task=nclasses&classid='+getValue();"></select>
<script>getCheckBox();</script>
<script>selectCheck('${art.art_classid }');</script>
</td>
</tr>
<tr>
<td>
&nbsp;小类分类
</td>
<td>&nbsp;
<c:forEach var="artNClasses" items="${listArtNClasses}">
<script>
getDataArray1('${artNClasses.classname }', '${artNClasses.classid }');
</script>
</c:forEach>

<select name="child_classid" id="child_classid" style="width:120px;" ></select>
<script>getCheckBox1();</script>
<script>selectCheck1('${art.art_nclassid }');</script>
</td>
</tr>

__________________________________________
希望能看懂........

2007-06-21 21:38
快速回复:急求一个JSP的三级联动
数据加载中...
 
   



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

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