| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 706 人关注过本帖
标题:[求助]请问有没有最简单的方法实现两个列表的内容移动.
只看楼主 加入收藏
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
 问题点数:0 回复次数:7 
[求助]请问有没有最简单的方法实现两个列表的内容移动.

请问有没有最简单的方法实现两个列表的内容相互移动.

然后怎么把第二个列表的内容写入数据库
列表1 列表2
[内容] [列表1的内容]

[此贴子已经被作者于2007-9-8 11:42:00编辑过]

搜索更多相关主题的帖子: 列表 数据库 
2007-09-08 11:38
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

楼主的意思是跟google的自定义主页一样表格单元格可以用鼠标托拽?

2007-09-08 14:29
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
得分:0 
是要实现下面这个功能.我现在已经搞定了功能.但是读去右边的数据出了问题.只能向数据库写第一个被添加的,第二个就不行.
各位高手.请指导指导.
图片附件: 游客没有浏览图片的权限,请 登录注册

2007-09-10 09:10
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

代码贴出来看看。

2007-09-10 14:49
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
得分:0 

这个是第一页的代码

[CODE]<!--#include file="conn.asp"-->
<%dim did,dname
did=request.querystring("downid")
dname=request.querystring("proname")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.box{ margin:10px auto auto 10px;border:solid 1px #006699;width:98%;}
.topbg{margin:1px 1px auto 1px; background:#006699;height:30px;width:auto;}
.config{margin:5px 5px auto 5px;width:auto;}
.input{border:solid 1px #d2d2d2;width:200px;height:25px;}
.button{border:solid 1px #d2d2d2;width:30px;height:25px;}
.input1{border:solid 1px #d2d2d2;width:500px;height:25px;}
.pictable{height:30px;width:600px;}
.font{color:#ffffff;font-size:"18px";text-align:center;}
.title{font-color:"#000000"; font-size:16px; font-family:宋体,Arial, Helvetica, sans-serif;background:#f1fafa;}
.table{background:#006699;}
.contents{font-color:"#000000"; font-size:12px; font-family:宋体,Arial, Helvetica, sans-serif;}
a{ text-decoration: none; color:#006699;}
a:hover{
display:block;
width:auto;
height:auto;
background-color: #d2d2d2;
}
-->
</style>
</head>
<script type="text/javascript">
<!--
function Mv(a,b){
var i=0;
var f=document.getElementById(a);
var t=document.getElementById(b);
for (var i=0; i<f.options.length;i++){
if(f.options[i].selected){
var no=new Option();
no.value=f.options[i].value;
no.text=f.options[i].text;
t.options[t.options.length]=no;}
}
Rv(a);
}
function Rv(o){
var o=document.getElementById(o);
for(var i=o.options.length-1;i>=0;i--){
if (o.options[i].selected && o.options[i] !=""){
o.options[i].value="";
o.options[i].text="";
o.options[i]=null;
}
}
}
-->

</script>

<body>
<div class="box">
<div class="topbg">
<div class="font">增加下载</div>
</div>
<div class="config">
<%dim rs1
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from download where downid="&did,dbconn,1,1%>
<form name="myform" method="post" action="downloadsave.asp?action=newdown" >
<table width="99%" border="0" cellpadding="1" cellspacing="1" class="table">
<tr class="title">
<td class="contents">Product Name</td>
<td><input name="proname" type="text" class="input" value="<%=rs1("proname")%>"/></td>
<td>Downtype</td>
<td><select class="input" name="downtypeid">
<%dim rs2
set rs2=server.createobject("adodb.recordset")
rs2.open"select * from download_class order by downtypeid ASC",dbconn,1,1
do while not rs2.eof%>
<option selected value="<%=rs2("downtypeid")%>"><%=rs2("downtypename")%></option>
<%rs2.movenext
loop
rs2.close
set rs2=nothing%>
</select></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents" >File Version </td>
<td ><input name="fversion" type="text" class="input" /></td>
<td >Filesize</td>
<td ><input name="fsize" type="text" class="input" /></td>
</tr>

<tr bgcolor="#f1fafa">
<td class="contents">Operation System </td>
<td colspan="3" ><table border="0" cellpadding="0" cellspacing="0"><tr><td><select name="sel1" size="8" multiple="true">
<option value="DOS">DOS</option>
<option value="Windows95/98">Windows95/98</option>
<option value="Windows2000">Windows2000</option>
<option value="Windows XP">Windows XP</option>
<option value="Windows XP 64Bit">Windows XP 64Bit</option>
<option value="Windows Server2003 32Bit">Windows Server2003 32Bit</option>
<option value="Windows Server2003 64Bit">Windows Server2003 64Bit</option>
<option value="Windows Vista x86 32Bit">Windows Vista x86 32Bit</option>
<option value="Windows Vista x64 64Bit">Windows Vista x64 64Bit</option>
<option value="Linux">Linux</option>
</select></td><td>
<input name=" " type="button" class="button" onClick="Mv('sel1','sel2');" value="→" />
<br/>
<input name=" " type="button" class="button" onClick="Mv('sel2','sel1');" value="←" /></td>
<td>
<select name="sel2" size="8" multiple="true">
</select> </td></tr></table></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Global</td>
<td colspan="3" ><input name="global1" type="text" class="input1"/></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">USA1</td>
<td colspan="3" ><input name="usa1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">USA2</td>
<td colspan="3" ><input name="usa2" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Europe</td>
<td colspan="3" ><input name="europe1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">China</td>
<td colspan="3" ><input name="china1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">TW</td>
<td colspan="3" ><input name="tw" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Other1</td>
<td colspan="3" ><input name="other1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Other2</td>
<td colspan="3" ><input name="other2" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Description</td>
<td colspan="3" ><textarea name="description1" style="display:none;"></textarea>
<iframe id="description1" src="jweditor/ewebeditor.asp?id=description1&style=mimi" frameborder="0" scrolling="no" width="600px" height="200px"></iframe></td>
</tr>

<tr class="contents" bgcolor="#f1fafa">
<td></td>
<td colspan="3" ><input name="Submit" type="submit" class="button" value="确定" />
<input name="Submit2" type="reset" class="button" value="重写" /></td>
</tr>
</table>
</form>
<%rs2.close
set rs2=nothing%>
</div>
</div>
</body>
</html>
[/CODE]

2007-09-10 16:26
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
得分:0 
第2页保存的代码. 是不是SEL2的值还需要转换???

[CODE]sub newdown()
set rs3=server.createobject("adodb.recordset")
rs3.open "select * from download where downid is null",dbconn,1,3
rs3.addnew
rs3("proname")=request.form("proname")
rs3("downtypeid")=request.form("downtypeid")
rs3("fversion")=request.form("fversion")
rs3("fsize")=request.form("fsize")
rs3("os")=request.form("sel2")
rs3("global")=request.form("global1")
rs3("usa1")=request.form("usa1")
rs3("usa2")=request.form("usa2")
rs3("europe")=request.form("europe1")
rs3("china")=request.form("china")
rs3("tw")=request.form("tw")
rs3("other1")=request.form("other1")
rs3("other2")=request.form("other2")
rs3("fdescription")=request.form("description1")
rs3("uptime")=now()
rs3.update
rs3.close
set rs3=nothing
response.write"<script>alert('增加成功');window.location.href='downloadlist.asp';</script>"
response.End()
end sub
[/CODE]
2007-09-10 16:28
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
以下是引用lecojason在2007-9-10 16:26:59的发言:

这个是第一页的代码

[CODE]<!--#include file="conn.asp"-->
<%dim did,dname
did=request.querystring("downid")
dname=request.querystring("proname")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.box{ margin:10px auto auto 10px;border:solid 1px #006699;width:98%;}
.topbg{margin:1px 1px auto 1px; background:#006699;height:30px;width:auto;}
.config{margin:5px 5px auto 5px;width:auto;}
.input{border:solid 1px #d2d2d2;width:200px;height:25px;}
.button{border:solid 1px #d2d2d2;width:30px;height:25px;}
.input1{border:solid 1px #d2d2d2;width:500px;height:25px;}
.pictable{height:30px;width:600px;}
.font{color:#ffffff;font-size:"18px";text-align:center;}
.title{font-color:"#000000"; font-size:16px; font-family:宋体,Arial, Helvetica, sans-serif;background:#f1fafa;}
.table{background:#006699;}
.contents{font-color:"#000000"; font-size:12px; font-family:宋体,Arial, Helvetica, sans-serif;}
a{ text-decoration: none; color:#006699;}
a:hover{
display:block;
width:auto;
height:auto;
background-color: #d2d2d2;
}
-->
</style>
</head>
<script type="text/javascript">
<!--
function Mv(a,b){
var i=0;
var f=document.getElementById(a);
var t=document.getElementById(b);
for (var i=0; i<f.options.length;i++){
if(f.options[i].selected){
var no=new Option();
no.value=f.options[i].value;
no.text=f.options[i].text;
t.options[t.options.length]=no;}
}
Rv(a);
}
function Rv(o){
var o=document.getElementById(o);
for(var i=o.options.length-1;i>=0;i--){
if (o.options[i].selected && o.options[i] !=""){
o.options[i].value="";
o.options[i].text="";
o.options[i]=null;
}
}
}
function Page_Submit()
{
var sel=document.myform.sel2;
for(var i=0;i<sel.options.length;i++)
{
document.myform.sel3.value+=sel2.options[i].value+"|";
}
}
-->

</script>

<body>
<div class="box">
<div class="topbg">
<div class="font">增加下载</div>
</div>
<div class="config">
<%dim rs1
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from download where downid="&did,dbconn,1,1%>
<form name="myform" method="post" action="downloadsave.asp?action=newdown" >
<table width="99%" border="0" cellpadding="1" cellspacing="1" class="table">
<tr class="title">
<td class="contents">Product Name</td>
<td><input name="proname" type="text" class="input" value="<%=rs1("proname")%>"/></td>
<td>Downtype</td>
<td><select class="input" name="downtypeid">
<%dim rs2
set rs2=server.createobject("adodb.recordset")
rs2.open"select * from download_class order by downtypeid ASC",dbconn,1,1
do while not rs2.eof%>
<option selected value="<%=rs2("downtypeid")%>"><%=rs2("downtypename")%></option>
<%rs2.movenext
loop
rs2.close
set rs2=nothing%>
</select></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents" >File Version </td>
<td ><input name="fversion" type="text" class="input" /></td>
<td >Filesize</td>
<td ><input name="fsize" type="text" class="input" /></td>
</tr>

<tr bgcolor="#f1fafa">
<td class="contents">Operation System </td>
<td colspan="3" ><table border="0" cellpadding="0" cellspacing="0"><tr><td><select name="sel1" size="8" multiple="true">
<option value="DOS">DOS</option>
<option value="Windows95/98">Windows95/98</option>
<option value="Windows2000">Windows2000</option>
<option value="Windows XP">Windows XP</option>
<option value="Windows XP 64Bit">Windows XP 64Bit</option>
<option value="Windows Server2003 32Bit">Windows Server2003 32Bit</option>
<option value="Windows Server2003 64Bit">Windows Server2003 64Bit</option>
<option value="Windows Vista x86 32Bit">Windows Vista x86 32Bit</option>
<option value="Windows Vista x64 64Bit">Windows Vista x64 64Bit</option>
<option value="Linux">Linux</option>
</select></td><td>
<input name=" " type="button" class="button" onClick="Mv('sel1','sel2');" value="→" />
<br/>
<input name=" " type="button" class="button" onClick="Mv('sel2','sel1');" value="←" /></td>
<td>
<select name="sel2" size="8" multiple="true">
</select> </td></tr></table></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Global</td>
<td colspan="3" ><input name="global1" type="text" class="input1"/></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">USA1</td>
<td colspan="3" ><input name="usa1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">USA2</td>
<td colspan="3" ><input name="usa2" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Europe</td>
<td colspan="3" ><input name="europe1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">China</td>
<td colspan="3" ><input name="china1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">TW</td>
<td colspan="3" ><input name="tw" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Other1</td>
<td colspan="3" ><input name="other1" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Other2</td>
<td colspan="3" ><input name="other2" type="text" class="input1" /></td>
</tr>
<tr bgcolor="#f1fafa">
<td class="contents">Description</td>
<td colspan="3" ><textarea name="description1" style="display:none;"></textarea>
<iframe id="description1" src="jweditor/ewebeditor.asp?id=description1&style=mimi" frameborder="0" scrolling="no" width="600px" height="200px"></iframe></td>
</tr>

<tr class="contents" bgcolor="#f1fafa">
<td></td>
<td colspan="3" ><input name="Submit" type="button" onClick="Page_Submit();" class="button" value="确定" />
<input name="Submit2" type="reset" class="button" value="重写" /></td>
</tr>
</table>
<input type="hidden" name="sel3" >
</form>
<%rs2.close
set rs2=nothing%>
</div>
</div>
</body>
</html>
[/CODE]

sub newdown()
set rs3=server.createobject("adodb.recordset")
rs3.open "select * from download where downid is null",dbconn,1,3
rs3.addnew
rs3("proname")=request.form("proname")
rs3("downtypeid")=request.form("downtypeid")
rs3("fversion")=request.form("fversion")
rs3("fsize")=request.form("fsize")
rs3("os")=Mid(request.form("sel2"),1,len(request.form("sel2"))-1)
rs3("global")=request.form("global1")
rs3("usa1")=request.form("usa1")
rs3("usa2")=request.form("usa2")
rs3("europe")=request.form("europe1")
rs3("china")=request.form("china")
rs3("tw")=request.form("tw")
rs3("other1")=request.form("other1")
rs3("other2")=request.form("other2")
rs3("fdescription")=request.form("description1")
rs3("uptime")=now()
rs3.update
rs3.close
set rs3=nothing
response.write"<script>alert('增加成功');window.location.href='downloadlist.asp';</script>"
response.End()
end sub
如果是所有列表的值写入数据库可以这样写。

2007-09-10 17:48
lecojason
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2007-9-5
收藏
得分:0 

不对了.报这个代码的
function Page_Submit()
{
var sel=document.myform.sel2;
for(var i=0;i<sel.options.length;i++)
{
document.myform.sel3.value+=sel2.options[i].value+"|";
}
}
的sel2未定义.
搞不懂了.

2007-09-10 18:36
快速回复:[求助]请问有没有最简单的方法实现两个列表的内容移动.
数据加载中...
 
   



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

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