<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>made by meixx</title>
<style type="css/text">
body{font-size:10pt}
</style>
<script language="javascript">
<!--
var curRowSource=null;
var curRowTarget=null;
function selectRow(obj){
if(curRowSource){
curRowSource.style.backgroundColor="#FFFFFF";
curRowSource.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowSource=obj;
var btns=document.getElementsByName("btn");
btns[0].disabled=false;
}
function selectRow1(obj){
if(curRowTarget){
curRowTarget.style.backgroundColor="#FFFFFF";
curRowTarget.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowTarget=obj;
var btns=document.getElementsByName("btn");
btns[2].disabled=false;
}
function Add(tbSou,tbTar){
var rowSou=null;
var newRow=tbTar.insertRow();
if(tbSou.id=="tbSource"){
rowSou=curRowSource;
newRow.attachEvent("onclick",function(){selectRow1(newRow);});
}
else{
rowSou=curRowTarget;
newRow.attachEvent("onclick",function(){selectRow(newRow);});
}
for(var i=0;i<rowSou.cells.length;i++){
var newCell=newRow.insertCell();
newCell.innerHTML=rowSou.cells[i].innerHTML;
}
tbSou.deleteRow(rowSou.rowIndex);
var btns=document.getElementsByName("btn");
btns[0].disabled=true;
btns[2].disabled=true;
}function AddAll(tbSource,tbTarget){
for(var i=1;;i++){
if(tbSource.rows.length==1) return;
tbSource.rows[1].click();
Add(tbSource,tbTarget);
}
}
function doSubmit(){
SelectAll(frmDisplay.dltTarget);
//frmDisplay.action="";//设置form 提交的action
alert(frmDisplay.action);
//frmDisplay.submit();//取消注释即可,提交上去的options
}
//->
</script>
</head><body>
<table width="550" border="1" style="border-collapse:collapse " bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td width="250" valign="top">
<table id="tbSource" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse;cursor:default" bordercolor="#CCFFFF" width="100%">
<tr>
<td align="center" width="25%">姓名</td><td align="center" width="25%">性别</td><td align="center" width="25%">年龄</td><td align="center" width="25%">身高</td>
</tr>
<tr onclick="selectRow(this)">
<td>冯程程</td><td>女</td><td>22</td><td>167</td>
</tr>
<tr onclick="selectRow(this)">
<td>任盈盈</td><td>女</td><td>19</td><td>168</td>
</tr>
<tr onclick="selectRow(this)">
<td>杨玉环</td><td>女</td><td>18</td><td>162</td>
</tr>
<tr onclick="selectRow(this)">
<td>赢政</td><td>男</td><td>45</td><td>182</td>
</tr>
<tr onclick="selectRow(this)">
<td>项少龙</td><td>男</td><td>28</td><td>176</td>
</tr>
</table>
</td>
<td width="50" valign="middle">
<br>
<p style="width:100%" align="center"><input name="btn" type="button" value="->" onClick="Add(document.all.tbSource,tbTarget)" title="添加" disabled></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="=>" onClick="AddAll(document.all.tbSource,tbTarget)" title="添加全部"></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="<-" onClick="Add(tbTarget,document.all.tbSource)" title="删除" disabled></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="<=" onClick="AddAll(tbTarget,document.all.tbSource)" title="删除全部"></p>
<br>
</td>
<td width="250" valign="top">
<form id="frmDisplay" action="xxx.jsp" method="post" style="margin:0 ">
<table id="tbTarget" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse" bordercolor="#CCFFFF" width="100%">
<tr>
<td align="center" width="25%">姓名</td><td align="center" width="25%">性别</td><td align="center" width="25%">年龄</td><td align="center" width="25%">身高</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td align="center">
<input type="reset" onClick="javascript:window.location.reload();" value="重置">
<input type="button" value="提交" onClick="doSubmit()">2
</td>
</tr>
</table></body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>made by meixx</title>
<style type="css/text">
body{font-size:10pt}
</style>
<script language="javascript">
<!--
var curRowSource=null;
var curRowTarget=null;
function selectRow(obj){
if(curRowSource){
curRowSource.style.backgroundColor="#FFFFFF";
curRowSource.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowSource=obj;
var btns=document.getElementsByName("btn");
btns[0].disabled=false;
}
function selectRow1(obj){
if(curRowTarget){
curRowTarget.style.backgroundColor="#FFFFFF";
curRowTarget.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowTarget=obj;
var btns=document.getElementsByName("btn");
btns[2].disabled=false;
}
function Add(tbSou,tbTar){
var rowSou=null;
var newRow=tbTar.insertRow();
if(tbSou.id=="tbSource"){
rowSou=curRowSource;
newRow.attachEvent("onclick",function(){selectRow1(newRow);});
}
else{
rowSou=curRowTarget;
newRow.attachEvent("onclick",function(){selectRow(newRow);});
}
for(var i=0;i<rowSou.cells.length;i++){
var newCell=newRow.insertCell();
newCell.innerHTML=rowSou.cells[i].innerHTML;
}
tbSou.deleteRow(rowSou.rowIndex);
var btns=document.getElementsByName("btn");
btns[0].disabled=true;
btns[2].disabled=true;
}function AddAll(tbSource,tbTarget){
for(var i=1;;i++){
if(tbSource.rows.length==1) return;
tbSource.rows[1].click();
Add(tbSource,tbTarget);
}
}
function doSubmit(){
SelectAll(frmDisplay.dltTarget);
//frmDisplay.action="";//设置form 提交的action
alert(frmDisplay.action);
//frmDisplay.submit();//取消注释即可,提交上去的options
}
//->
</script>
</head><body>
<table width="550" border="1" style="border-collapse:collapse " bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td width="250" valign="top">
<table id="tbSource" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse;cursor:default" bordercolor="#CCFFFF" width="100%">
<tr>
<td align="center" width="25%">姓名</td><td align="center" width="25%">性别</td><td align="center" width="25%">年龄</td><td align="center" width="25%">身高</td>
</tr>
<tr onclick="selectRow(this)">
<td>冯程程</td><td>女</td><td>22</td><td>167</td>
</tr>
<tr onclick="selectRow(this)">
<td>任盈盈</td><td>女</td><td>19</td><td>168</td>
</tr>
<tr onclick="selectRow(this)">
<td>杨玉环</td><td>女</td><td>18</td><td>162</td>
</tr>
<tr onclick="selectRow(this)">
<td>赢政</td><td>男</td><td>45</td><td>182</td>
</tr>
<tr onclick="selectRow(this)">
<td>项少龙</td><td>男</td><td>28</td><td>176</td>
</tr>
</table>
</td>
<td width="50" valign="middle">
<br>
<p style="width:100%" align="center"><input name="btn" type="button" value="->" onClick="Add(document.all.tbSource,tbTarget)" title="添加" disabled></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="=>" onClick="AddAll(document.all.tbSource,tbTarget)" title="添加全部"></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="<-" onClick="Add(tbTarget,document.all.tbSource)" title="删除" disabled></p>
<p style="width:100%" align="center"><input name="btn" type="button" value="<=" onClick="AddAll(tbTarget,document.all.tbSource)" title="删除全部"></p>
<br>
</td>
<td width="250" valign="top">
<form id="frmDisplay" action="xxx.jsp" method="post" style="margin:0 ">
<table id="tbTarget" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse" bordercolor="#CCFFFF" width="100%">
<tr>
<td align="center" width="25%">姓名</td><td align="center" width="25%">性别</td><td align="center" width="25%">年龄</td><td align="center" width="25%">身高</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td align="center">
<input type="reset" onClick="javascript:window.location.reload();" value="重置">
<input type="button" value="提交" onClick="doSubmit()">2
</td>
</tr>
</table></body>
</html>
解决方案 »
- FireFox下怎么导出table到Excel
- 谁来帮我改下 JS+FLASH 广告轮显的标题!!!!!!。。谢谢~
- 请问csdn上的在线编辑器里面的[code][/code]之间的代码是怎么识别的(自动排版)
- 读取XML数据岛,显示数据问题
- 如何实现不需用户任何操作的自动web后台打印
- 关于如何让一个自动添加的option的值放在第一位的问题
- 当DropDownList得到焦点的时候,能不能触发它的点击事件,自动下拉?
- 如何横向打印?????????
- 使用VML遇到的一个问题
- 今天混进了专家版,散代码
- 急!在线等待。用Window.Open方法打开一个服务器端存在的文件时,可不可以不管文件类型都提示保存打开确认对话框
- 如何实现网易首页导航条之间栏目切换
按下移动后 遍历table1.rows 判断tr的Attribute里面的值 然后在table2.tbody下面appendChild table1.rows的复制品就可以了