| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 594 人关注过本帖
标题:斑竹,救急,!!!!!!!!
取消只看楼主 加入收藏
luke911
Rank: 1
等 级:新手上路
帖 子:66
专家分:0
注 册:2005-10-21
收藏
 问题点数:0 回复次数:1 
斑竹,救急,!!!!!!!!
添加成员:
>" name=Submit4>
小弟写了个将selectA中的数据添加到selectB中控件,现在想取出selectB中的值存到数据库中,但是不知道该怎么做,请斑竹们指点下
搜索更多相关主题的帖子: 斑竹 
2005-11-21 15:06
luke911
Rank: 1
等 级:新手上路
帖 子:66
专家分:0
注 册:2005-10-21
收藏
得分:0 

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
function addSelect(){
var b,c;
b=document.rework.selectA;
c=document.rework.selectB;
for(i=0;i<b.length;i++){
if(b.selectedIndex!=-1){
c.options[c.length]=new Option()
c.options[c.length-1].value=b.options[b.selectedIndex].value;
c.options[c.length-1].text=b.options[b.selectedIndex].text;
b.options[b.selectedIndex].selected=false;
}
}
}

function deleteSelect(){
var c;
c=document.rework.selectB;
if(c.selectedIndex<0){
window.alert("请先选择要删除用户名!")
return;}
c.options[c.selectedIndex]=null;
}
</script>
<body>
<form name="rework" action="">
<table width="54%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#006699" style="border-collapse:collapse">
<tr>
<td height="77" bgcolor="#81C5E0" class="black12"><div align="center">添加成员:</div></td>
<td width="150">
<select name="selectA" size="7" multiple style="width:150px">
<option>111111</option>
<option>222222</option>
<option>333333</option>
<option>444444</option>
</select></td>
<td width="64" align="center">
<input type="button" name="Submit4" value="添加>>" onClick="addSelect()">
<input type="button" name="Submit5" value="<<删除" onClick="deleteSelect()"></td>
<td width="151" >
<select name="selectB" size="7" multiple style="width:150px">
</select></td>
</tr>
<tr>
<td colspan="6" align="center" bgcolor="#81C5E0" class="black12"><input type="button" name="Submit4" value="修改">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="Submit4" value="返回" ></td>
</tr>
</table>
</form>
</body>
<html>

2005-11-21 15:08
快速回复:斑竹,救急,!!!!!!!!
数据加载中...
 
   



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

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