******* *******
* aaa * * aaa *
* bbb * >>> * *
* ccc * * *
* ddd * <<< * *
* * * *
******* *******
我用的方法是:
左边的框的数据是在数据库中取来的,添加到右边的框中,右框中的数据可以删除,
最后将右框中的数据存到数据库中。
由于我做的是流程所以
我是建了一个临时表来存数据,最后确定流程后写到流程表中
但当遇到多人操作时,需要建很多临时表。
请问是否有更好的方法来解决。
最好是有源码!分不是问题。我的信箱是jin888aaa@163.com
谢谢!
6 个解决方案
#1
可以考虑在客户端写文本文件
#2
应该在服务器端专门建立一个文件夹来
存储临时文本文件,临时文本文件中记录的是临时记录(有一定的格式)
不要得时候可以删除掉.
存储临时文本文件,临时文本文件中记录的是临时记录(有一定的格式)
不要得时候可以删除掉.
#3
<script language=javascript>
function Add(obj){
if (sel1.length!=0) {
sel2.options.add(new Option(obj.value,obj.value));
sel1.options.remove(obj.selectedIndex);
}
if (sel1.length!=0) sel1.options[0].selected=true;
}
function Del(obj){
if (sel2.length!=0) {
sel1.options.add(new Option(obj.value,obj.value));
sel2.options.remove(obj.selectedIndex);
}
if (sel2.length!=0) sel2.options[0].selected=true;
}
</script>
<select multiple name=sel1>
<option value=aa selected>aa</option>
<option value=bb>bb</option>
<option value=cc>cc</option>
</select>
<input type=button value='>>' name=add onclick='javascript:Add(sel1);'>
<input type=button value='<<' name=del onclick='javascript:Del(sel2);'>
<select multiple name=sel2>
<option value=11 selected>11</option>
<option value=22>22</option>
<option value=33>33</option>
</select>
function Add(obj){
if (sel1.length!=0) {
sel2.options.add(new Option(obj.value,obj.value));
sel1.options.remove(obj.selectedIndex);
}
if (sel1.length!=0) sel1.options[0].selected=true;
}
function Del(obj){
if (sel2.length!=0) {
sel1.options.add(new Option(obj.value,obj.value));
sel2.options.remove(obj.selectedIndex);
}
if (sel2.length!=0) sel2.options[0].selected=true;
}
</script>
<select multiple name=sel1>
<option value=aa selected>aa</option>
<option value=bb>bb</option>
<option value=cc>cc</option>
</select>
<input type=button value='>>' name=add onclick='javascript:Add(sel1);'>
<input type=button value='<<' name=del onclick='javascript:Del(sel2);'>
<select multiple name=sel2>
<option value=11 selected>11</option>
<option value=22>22</option>
<option value=33>33</option>
</select>
#4
假设你只想实现上述功能,那是可以的
如下程序,要自己加一些判断
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<SELECT NAME="select1" ondblclick="move_slt()" size="5" style="width:100">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</SELECT>
<SELECT NAME="select2" ondblclick="delete_slt()" size="5" style="width:100">
</SELECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="vbScript">
<!--
sub move_slt()
svalue=document.all("select1").options(document.all("select1").selectedindex).value
stxt=document.all("select1").options(document.all("select1").selectedindex).text
document.all("select2").length=document.all("select2").length+1
document.all("select2").options(document.all("select2").length-1).value=svalue
document.all("select2").options(document.all("select2").length-1).text=stxt
end sub
sub delete_slt()
k=document.all("select2").selectedindex
for i=k to document.all("select2").length-2
document.all("select2").options(i).value=document.all("select2").options(i+1).value
document.all("select2").options(i).text=document.all("select2").options(i+1).text
next
document.all("select2").length=document.all("select2").length-1
end sub
//-->
</SCRIPT>
如下程序,要自己加一些判断
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<SELECT NAME="select1" ondblclick="move_slt()" size="5" style="width:100">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</SELECT>
<SELECT NAME="select2" ondblclick="delete_slt()" size="5" style="width:100">
</SELECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="vbScript">
<!--
sub move_slt()
svalue=document.all("select1").options(document.all("select1").selectedindex).value
stxt=document.all("select1").options(document.all("select1").selectedindex).text
document.all("select2").length=document.all("select2").length+1
document.all("select2").options(document.all("select2").length-1).value=svalue
document.all("select2").options(document.all("select2").length-1).text=stxt
end sub
sub delete_slt()
k=document.all("select2").selectedindex
for i=k to document.all("select2").length-2
document.all("select2").options(i).value=document.all("select2").options(i+1).value
document.all("select2").options(i).text=document.all("select2").options(i+1).text
next
document.all("select2").length=document.all("select2").length-1
end sub
//-->
</SCRIPT>
#5
function MoveOptionItem(lstSourceList,lstDestList){
var oOption;
for (j = lstSourceList.options.length-1; j >= 0; j--){
if (lstSourceList.options(j).selected){
oOption = document.createElement("OPTION");
oOption.text = lstSourceList.options(j).text;
oOption.value = lstSourceList.options(j).value;
lstDestList.add(oOption);
lstSourceList.remove(j);
}
}
}
function ss_ok(){
var oOption;
var temp_str="";
var temp_str1="";
for (j = s_select.options.length-1; j >= 0; j--){
temp_str += "," + s_select.options(j).text;
temp_str1 += "," + s_select.options(j).value;
}
form1.jyfw.value=ss_len(temp_str);
form1.jyfw1.value=ss_len(temp_str1);
ss_jyfw.style.visibility="hidden";
}
function ss_jyfw_ini(top,left){
ss_jyfw.style.visibility="visible";
ss_jyfw.style.top=top;
ss_jyfw.style.left=left;
}
<select class="sel" style="width:100%;overflowx:scroll; background-color:#EDC456" id = "f_select" name = "f_select" size = 10 MULTIPLE>
<option value="0">hcfghfg</option>
<option value="1">dgbxcghg</option>
</select>
</td>
<td width="20%" align="center" height="133">
<input class="btn" type="button" value="增加" id="cmdSelect" name="cmdSelect" style="width:30pt" onclick="javascript:MoveOptionItem(f_select,s_select)"><p>
<input class="btn" type="button" value="删除" id="cmdUnSelect" name="cmdUnSelect" style="width:30pt" onclick="javascript:MoveOptionItem(s_select,f_select)"></td>
<td width="40%" height="133">
<select class="sel" style="width:100%; background-color:#EDC456" id = "s_select" name = "s_select" size = 10 MULTIPLE>
</select>
var oOption;
for (j = lstSourceList.options.length-1; j >= 0; j--){
if (lstSourceList.options(j).selected){
oOption = document.createElement("OPTION");
oOption.text = lstSourceList.options(j).text;
oOption.value = lstSourceList.options(j).value;
lstDestList.add(oOption);
lstSourceList.remove(j);
}
}
}
function ss_ok(){
var oOption;
var temp_str="";
var temp_str1="";
for (j = s_select.options.length-1; j >= 0; j--){
temp_str += "," + s_select.options(j).text;
temp_str1 += "," + s_select.options(j).value;
}
form1.jyfw.value=ss_len(temp_str);
form1.jyfw1.value=ss_len(temp_str1);
ss_jyfw.style.visibility="hidden";
}
function ss_jyfw_ini(top,left){
ss_jyfw.style.visibility="visible";
ss_jyfw.style.top=top;
ss_jyfw.style.left=left;
}
<select class="sel" style="width:100%;overflowx:scroll; background-color:#EDC456" id = "f_select" name = "f_select" size = 10 MULTIPLE>
<option value="0">hcfghfg</option>
<option value="1">dgbxcghg</option>
</select>
</td>
<td width="20%" align="center" height="133">
<input class="btn" type="button" value="增加" id="cmdSelect" name="cmdSelect" style="width:30pt" onclick="javascript:MoveOptionItem(f_select,s_select)"><p>
<input class="btn" type="button" value="删除" id="cmdUnSelect" name="cmdUnSelect" style="width:30pt" onclick="javascript:MoveOptionItem(s_select,f_select)"></td>
<td width="40%" height="133">
<select class="sel" style="width:100%; background-color:#EDC456" id = "s_select" name = "s_select" size = 10 MULTIPLE>
</select>
#6
<table border=0 cellpadding=0 cellspacing=0><form name=meizz>
<tr><td>
<select id=list1 size=8 onchange="change1()">
<option value=A>aaaaaaaaaa
<option value=B>bbbbbbbbbb
<option value=C>cccccccccc
<option value=D>dddddddddd
<option value=E>eeeeeeeeee
<option value=F>ffffffffff
<option value=G>gggggggggg
<option value=H>hhhhhhhhhh
</select></td>
<td width=80 align=center>
<input name=add type=button value="添加 →" onclick="addOption()" disabled><br><br>
<input name=sub type=button value="← 删除" onclick="subOption()" disabled>
</td><td>
<select id=list2 size=8 onchange="change2()">
</select>
</td></tr></form>
</table>
<script language="JavaScript"><!--
function change1(){document.meizz.add.disabled = false;}
function change2(){document.meizz.sub.disabled = false;}
function addOption()
{
var e = document.meizz.list1;
var b = document.meizz.list2;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.add.disabled = true;
}
function subOption()
{
var e = document.meizz.list2;
var b = document.meizz.list1;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.sub.disabled = true;
}
//--></script>
<tr><td>
<select id=list1 size=8 onchange="change1()">
<option value=A>aaaaaaaaaa
<option value=B>bbbbbbbbbb
<option value=C>cccccccccc
<option value=D>dddddddddd
<option value=E>eeeeeeeeee
<option value=F>ffffffffff
<option value=G>gggggggggg
<option value=H>hhhhhhhhhh
</select></td>
<td width=80 align=center>
<input name=add type=button value="添加 →" onclick="addOption()" disabled><br><br>
<input name=sub type=button value="← 删除" onclick="subOption()" disabled>
</td><td>
<select id=list2 size=8 onchange="change2()">
</select>
</td></tr></form>
</table>
<script language="JavaScript"><!--
function change1(){document.meizz.add.disabled = false;}
function change2(){document.meizz.sub.disabled = false;}
function addOption()
{
var e = document.meizz.list1;
var b = document.meizz.list2;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.add.disabled = true;
}
function subOption()
{
var e = document.meizz.list2;
var b = document.meizz.list1;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.sub.disabled = true;
}
//--></script>
#1
可以考虑在客户端写文本文件
#2
应该在服务器端专门建立一个文件夹来
存储临时文本文件,临时文本文件中记录的是临时记录(有一定的格式)
不要得时候可以删除掉.
存储临时文本文件,临时文本文件中记录的是临时记录(有一定的格式)
不要得时候可以删除掉.
#3
<script language=javascript>
function Add(obj){
if (sel1.length!=0) {
sel2.options.add(new Option(obj.value,obj.value));
sel1.options.remove(obj.selectedIndex);
}
if (sel1.length!=0) sel1.options[0].selected=true;
}
function Del(obj){
if (sel2.length!=0) {
sel1.options.add(new Option(obj.value,obj.value));
sel2.options.remove(obj.selectedIndex);
}
if (sel2.length!=0) sel2.options[0].selected=true;
}
</script>
<select multiple name=sel1>
<option value=aa selected>aa</option>
<option value=bb>bb</option>
<option value=cc>cc</option>
</select>
<input type=button value='>>' name=add onclick='javascript:Add(sel1);'>
<input type=button value='<<' name=del onclick='javascript:Del(sel2);'>
<select multiple name=sel2>
<option value=11 selected>11</option>
<option value=22>22</option>
<option value=33>33</option>
</select>
function Add(obj){
if (sel1.length!=0) {
sel2.options.add(new Option(obj.value,obj.value));
sel1.options.remove(obj.selectedIndex);
}
if (sel1.length!=0) sel1.options[0].selected=true;
}
function Del(obj){
if (sel2.length!=0) {
sel1.options.add(new Option(obj.value,obj.value));
sel2.options.remove(obj.selectedIndex);
}
if (sel2.length!=0) sel2.options[0].selected=true;
}
</script>
<select multiple name=sel1>
<option value=aa selected>aa</option>
<option value=bb>bb</option>
<option value=cc>cc</option>
</select>
<input type=button value='>>' name=add onclick='javascript:Add(sel1);'>
<input type=button value='<<' name=del onclick='javascript:Del(sel2);'>
<select multiple name=sel2>
<option value=11 selected>11</option>
<option value=22>22</option>
<option value=33>33</option>
</select>
#4
假设你只想实现上述功能,那是可以的
如下程序,要自己加一些判断
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<SELECT NAME="select1" ondblclick="move_slt()" size="5" style="width:100">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</SELECT>
<SELECT NAME="select2" ondblclick="delete_slt()" size="5" style="width:100">
</SELECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="vbScript">
<!--
sub move_slt()
svalue=document.all("select1").options(document.all("select1").selectedindex).value
stxt=document.all("select1").options(document.all("select1").selectedindex).text
document.all("select2").length=document.all("select2").length+1
document.all("select2").options(document.all("select2").length-1).value=svalue
document.all("select2").options(document.all("select2").length-1).text=stxt
end sub
sub delete_slt()
k=document.all("select2").selectedindex
for i=k to document.all("select2").length-2
document.all("select2").options(i).value=document.all("select2").options(i+1).value
document.all("select2").options(i).text=document.all("select2").options(i+1).text
next
document.all("select2").length=document.all("select2").length-1
end sub
//-->
</SCRIPT>
如下程序,要自己加一些判断
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<SELECT NAME="select1" ondblclick="move_slt()" size="5" style="width:100">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</SELECT>
<SELECT NAME="select2" ondblclick="delete_slt()" size="5" style="width:100">
</SELECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="vbScript">
<!--
sub move_slt()
svalue=document.all("select1").options(document.all("select1").selectedindex).value
stxt=document.all("select1").options(document.all("select1").selectedindex).text
document.all("select2").length=document.all("select2").length+1
document.all("select2").options(document.all("select2").length-1).value=svalue
document.all("select2").options(document.all("select2").length-1).text=stxt
end sub
sub delete_slt()
k=document.all("select2").selectedindex
for i=k to document.all("select2").length-2
document.all("select2").options(i).value=document.all("select2").options(i+1).value
document.all("select2").options(i).text=document.all("select2").options(i+1).text
next
document.all("select2").length=document.all("select2").length-1
end sub
//-->
</SCRIPT>
#5
function MoveOptionItem(lstSourceList,lstDestList){
var oOption;
for (j = lstSourceList.options.length-1; j >= 0; j--){
if (lstSourceList.options(j).selected){
oOption = document.createElement("OPTION");
oOption.text = lstSourceList.options(j).text;
oOption.value = lstSourceList.options(j).value;
lstDestList.add(oOption);
lstSourceList.remove(j);
}
}
}
function ss_ok(){
var oOption;
var temp_str="";
var temp_str1="";
for (j = s_select.options.length-1; j >= 0; j--){
temp_str += "," + s_select.options(j).text;
temp_str1 += "," + s_select.options(j).value;
}
form1.jyfw.value=ss_len(temp_str);
form1.jyfw1.value=ss_len(temp_str1);
ss_jyfw.style.visibility="hidden";
}
function ss_jyfw_ini(top,left){
ss_jyfw.style.visibility="visible";
ss_jyfw.style.top=top;
ss_jyfw.style.left=left;
}
<select class="sel" style="width:100%;overflowx:scroll; background-color:#EDC456" id = "f_select" name = "f_select" size = 10 MULTIPLE>
<option value="0">hcfghfg</option>
<option value="1">dgbxcghg</option>
</select>
</td>
<td width="20%" align="center" height="133">
<input class="btn" type="button" value="增加" id="cmdSelect" name="cmdSelect" style="width:30pt" onclick="javascript:MoveOptionItem(f_select,s_select)"><p>
<input class="btn" type="button" value="删除" id="cmdUnSelect" name="cmdUnSelect" style="width:30pt" onclick="javascript:MoveOptionItem(s_select,f_select)"></td>
<td width="40%" height="133">
<select class="sel" style="width:100%; background-color:#EDC456" id = "s_select" name = "s_select" size = 10 MULTIPLE>
</select>
var oOption;
for (j = lstSourceList.options.length-1; j >= 0; j--){
if (lstSourceList.options(j).selected){
oOption = document.createElement("OPTION");
oOption.text = lstSourceList.options(j).text;
oOption.value = lstSourceList.options(j).value;
lstDestList.add(oOption);
lstSourceList.remove(j);
}
}
}
function ss_ok(){
var oOption;
var temp_str="";
var temp_str1="";
for (j = s_select.options.length-1; j >= 0; j--){
temp_str += "," + s_select.options(j).text;
temp_str1 += "," + s_select.options(j).value;
}
form1.jyfw.value=ss_len(temp_str);
form1.jyfw1.value=ss_len(temp_str1);
ss_jyfw.style.visibility="hidden";
}
function ss_jyfw_ini(top,left){
ss_jyfw.style.visibility="visible";
ss_jyfw.style.top=top;
ss_jyfw.style.left=left;
}
<select class="sel" style="width:100%;overflowx:scroll; background-color:#EDC456" id = "f_select" name = "f_select" size = 10 MULTIPLE>
<option value="0">hcfghfg</option>
<option value="1">dgbxcghg</option>
</select>
</td>
<td width="20%" align="center" height="133">
<input class="btn" type="button" value="增加" id="cmdSelect" name="cmdSelect" style="width:30pt" onclick="javascript:MoveOptionItem(f_select,s_select)"><p>
<input class="btn" type="button" value="删除" id="cmdUnSelect" name="cmdUnSelect" style="width:30pt" onclick="javascript:MoveOptionItem(s_select,f_select)"></td>
<td width="40%" height="133">
<select class="sel" style="width:100%; background-color:#EDC456" id = "s_select" name = "s_select" size = 10 MULTIPLE>
</select>
#6
<table border=0 cellpadding=0 cellspacing=0><form name=meizz>
<tr><td>
<select id=list1 size=8 onchange="change1()">
<option value=A>aaaaaaaaaa
<option value=B>bbbbbbbbbb
<option value=C>cccccccccc
<option value=D>dddddddddd
<option value=E>eeeeeeeeee
<option value=F>ffffffffff
<option value=G>gggggggggg
<option value=H>hhhhhhhhhh
</select></td>
<td width=80 align=center>
<input name=add type=button value="添加 →" onclick="addOption()" disabled><br><br>
<input name=sub type=button value="← 删除" onclick="subOption()" disabled>
</td><td>
<select id=list2 size=8 onchange="change2()">
</select>
</td></tr></form>
</table>
<script language="JavaScript"><!--
function change1(){document.meizz.add.disabled = false;}
function change2(){document.meizz.sub.disabled = false;}
function addOption()
{
var e = document.meizz.list1;
var b = document.meizz.list2;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.add.disabled = true;
}
function subOption()
{
var e = document.meizz.list2;
var b = document.meizz.list1;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.sub.disabled = true;
}
//--></script>
<tr><td>
<select id=list1 size=8 onchange="change1()">
<option value=A>aaaaaaaaaa
<option value=B>bbbbbbbbbb
<option value=C>cccccccccc
<option value=D>dddddddddd
<option value=E>eeeeeeeeee
<option value=F>ffffffffff
<option value=G>gggggggggg
<option value=H>hhhhhhhhhh
</select></td>
<td width=80 align=center>
<input name=add type=button value="添加 →" onclick="addOption()" disabled><br><br>
<input name=sub type=button value="← 删除" onclick="subOption()" disabled>
</td><td>
<select id=list2 size=8 onchange="change2()">
</select>
</td></tr></form>
</table>
<script language="JavaScript"><!--
function change1(){document.meizz.add.disabled = false;}
function change2(){document.meizz.sub.disabled = false;}
function addOption()
{
var e = document.meizz.list1;
var b = document.meizz.list2;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.add.disabled = true;
}
function subOption()
{
var e = document.meizz.list2;
var b = document.meizz.list1;
var eSelected = e.options[e.selectedIndex];
var opt = new Option(eSelected.text, eSelected.value, true, false)
b.options[b.options.length] = opt;
e.options[e.selectedIndex].removeNode(true);
document.meizz.sub.disabled = true;
}
//--></script>