📄 tt2.jsp
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>发文枢纽单位</title>
<link href="../../css/global.css" type=text/css rel=stylesheet>
</head>
<body topmargin=0 leftmargin=0>
<form name=form_setorg method=post>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/left.gif" >
<tr>
<td height="23"><div align="center"> <font size=4><b>fdsafa</b></font>
</div></td>
<td width=30><font size=2><a href="javascript:window.close();">关闭</a></font></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="16" cellspacing="0" class="BodContent" style="border-collapse: collapse" bordercolor="#111111">
<tr bgcolor="#F7F7F7">
<td height="100%"> <font size=2>可选列表</font>
<select name=leftselect size=10 style="width:130;" ondblclick="left_dblclick(this.selectedIndex)">
<option value="1">aaa</option>
<option value="2">bbb</option>
</select>
</td>
<td height="100%" align=center>
<input type=button value="> " title="添加" class=button onclick="add()">
<input type=button value=">>" title="全部添加" class=button onclick="add_all()">
<input type=button value="< " title="删除" class=button onclick="del()">
<input type=button value="<<" title="全部删除" class=button onclick="del_all()">
<br><br>
<button class=button onclick="form_reset()">重置</button><br>
<button class=button onclick="form_submit()">提交</button>
</td>
<td height="100%"> <font size=2>已选列表</font>
<select name=rightselect size=10 style="width:130;">
<script>
var text = "txt";
var str = window.opener.document.all.txt.value+",";
var n=0;
for(var i=0;i<str.length;i++)
{
if(str.charAt(i)==',')n++;
}
if(str!=",")
{
for(var i=0;i<n;i++)
{
var index = str.indexOf(',');
var value = str.substring(0,index);
document.write("<option value=\'"+i+"\'>"+value+"</option>");
str = str.substring(index+1,str.length);
}
}
</script>
</select>
</td>
</tr>
<tr colspan=3 bgcolor="#F7F7F7"><td height=3></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/left.gif" onselectstart="selectstart()">
<tr>
<td height="21"><div align="center">
<font size=2>中煤华辰办公自动化系统 2003</font>
</div></td>
</tr>
</table>
</form>
</body>
<script language=javascript>
//添加一个
function add()
{
left_dblclick(document.all.leftselect.selectedIndex);
}
//添加全部
function add_all()
{
//清空已选列表
var length = document.all.rightselect.length;
for(var i=0;i<length;i++)
{
document.all.rightselect.options.remove(0);
}
//添加全部列表
for(var i=0;i<document.all.leftselect.length;i++)
{
var item = document.all.leftselect.options[i].text;
var oOption = document.createElement("OPTION");
document.all.rightselect.options.add(oOption);
oOption.innerText = item;
}
}
//删除一个
function del()
{
document.all.rightselect.options.remove(document.all.rightselect.selectedIndex);
}
//删除全部
function del_all()
{
var length = document.all.rightselect.length;
for(var i=0;i<length;i++)
{
document.all.rightselect.options.remove(0);
}
}
//重置
function form_reset()
{
document.all.form_setorg.action = "tt2.jsp";
document.all.form_setorg.submit();
}
//提交
function form_submit()
{
var all = "";
for(var i=0;i<document.all.rightselect.length;i++)
{
if(all!="")all+=",";
all+= document.all.rightselect.options[i].text;
}
window.opener.document.all.txt.value=all;
window.close();
}
//双击添加
function left_dblclick(index)
{
var item = document.all.leftselect.options[index].text;
//检查是否有重复的
var bool = 0;
for(var i=0;i<document.all.rightselect.length;i++)
{
if(document.all.rightselect.options[i].text==item)
{
bool = 1;
break;
}
}
//添加
if(bool==0)
{
var oOption = document.createElement("OPTION");
document.all.rightselect.options.add(oOption);
oOption.innerText = item;
}
}
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -