实现动态页面传值 options动态显示数据
2008-10-25 11:58
656 查看
Vol_Outlay_ChooseSure
function MoveSingleItem(sel_source, sel_dest){
if (sel_source.selectedIndex==-1){
if(sel_source.options.length>0){
var SelectedText = sel_source.options[sel_source.options.length-1].text;
var objItemValue = sel_source.options[sel_source.options.length-1].value;
sel_source.options.remove(sel_source.options.length-1);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}else{
for(var i = sel_source.options.length-1; i >= 0; i--){
if (sel_source.options[i].selected == true) {
var SelectedText = sel_source.options[i].text;
var objItemValue = sel_source.options[i].value;
sel_source.options.remove(i);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}
}
}
function re(sel_dest){
window.returnValue=getSelectedValue(sel_dest);
window.close();
}
function getSelectedValue(sel_dest){
var arr = new Array();
for(var i = sel_dest.options.length-1; i >= 0; i--){
arr[i] = sel_dest.options[i].value;
}
return arr;
}
function removeOption(sel){
sel.options.remove(0);
}
<html>
<head>
<title>
Vol_Outlay_ChooseSure
</title>
<link href="../css/index.css" rel="stylesheet" type="text/css"/>
</head>
<body bgcolor="#ffffff" onLoad="removeOption(SelectedItem);">
<table width="80%" height="47%" border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="25%" height="34" align="right" valign="bottom" class="text">选择组</td>
<td width="12%" height="34" align="right" valign="bottom" class="text"> </td>
<td width="%" height="34" align="center" valign="bottom" class="text">未选人员</td>
<td width="12%"> </td>
<td width="25%" valign="bottom" class="text">已选人员</td>
</tr>
<tr><td> </td><td> </td>
<td height="162" align="" valign="top">
<select name="SelectedItem" style="width:100%" id="SelectedItem" size="12" multiple="true">
<option>姚明</option>
<option>刘翔</option>
<option>李小双</option>
<option>刘德华</option>
<option>黎明</option>
<option>张学友</option>
<option>王晶</option>
<option>张艺谋</option>
<option>郑秀文</option>
<option>杰克逊</option>
</select>
</td>
<td align="center" valign="top"><br/>
<br/>
<br/>
<br/>
<button onClick="MoveSingleItem(WaitSelectItem, SelectedItem)" class="bn"><<</button>
<br/>
<br/>
<br/>
<button onClick="MoveSingleItem(SelectedItem, WaitSelectItem)" class="bn">>></button></td>
<td valign="top"><select name="WaitSelectItem" style="width:100%" size=12 multiple="true">
</select></td>
</tr>
<tr>
<td align="center" colspan="5"> </td>
</tr>
<tr>
<td align="center" colspan="5">
<input type="button" name="chooseOk" class="bn" value="确 定" onClick="re(WaitSelectItem);"/>
<input type="button" name="reset" class="bn" value="取 消" onClick="javascript:window.close();"/></td>
</tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
function MoveSingleItem(sel_source, sel_dest){
if (sel_source.selectedIndex==-1){
if(sel_source.options.length>0){
var SelectedText = sel_source.options[sel_source.options.length-1].text;
var objItemValue = sel_source.options[sel_source.options.length-1].value;
sel_source.options.remove(sel_source.options.length-1);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}else{
for(var i = sel_source.options.length-1; i >= 0; i--){
if (sel_source.options[i].selected == true) {
var SelectedText = sel_source.options[i].text;
var objItemValue = sel_source.options[i].value;
sel_source.options.remove(i);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}
}
}
function re(sel_dest){
window.returnValue=getSelectedValue(sel_dest);
window.close();
}
function getSelectedValue(sel_dest){
var arr = new Array();
for(var i = sel_dest.options.length-1; i >= 0; i--){
arr[i] = sel_dest.options[i].value;
}
return arr;
}
function removeOption(sel){
sel.options.remove(0);
}
</script>
选择组 | 未选人员 | 已选人员 | ||
姚明 刘翔 李小双 刘德华 黎明 张学友 王晶 张艺谋 郑秀文 杰克逊 | << >> | |||
if (sel_source.selectedIndex==-1){
if(sel_source.options.length>0){
var SelectedText = sel_source.options[sel_source.options.length-1].text;
var objItemValue = sel_source.options[sel_source.options.length-1].value;
sel_source.options.remove(sel_source.options.length-1);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}else{
for(var i = sel_source.options.length-1; i >= 0; i--){
if (sel_source.options[i].selected == true) {
var SelectedText = sel_source.options[i].text;
var objItemValue = sel_source.options[i].value;
sel_source.options.remove(i);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}
}
}
function re(sel_dest){
window.returnValue=getSelectedValue(sel_dest);
window.close();
}
function getSelectedValue(sel_dest){
var arr = new Array();
for(var i = sel_dest.options.length-1; i >= 0; i--){
arr[i] = sel_dest.options[i].value;
}
return arr;
}
function removeOption(sel){
sel.options.remove(0);
}
<html>
<head>
<title>
Vol_Outlay_ChooseSure
</title>
<link href="../css/index.css" rel="stylesheet" type="text/css"/>
</head>
<body bgcolor="#ffffff" onLoad="removeOption(SelectedItem);">
<table width="80%" height="47%" border="1" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="25%" height="34" align="right" valign="bottom" class="text">选择组</td>
<td width="12%" height="34" align="right" valign="bottom" class="text"> </td>
<td width="%" height="34" align="center" valign="bottom" class="text">未选人员</td>
<td width="12%"> </td>
<td width="25%" valign="bottom" class="text">已选人员</td>
</tr>
<tr><td> </td><td> </td>
<td height="162" align="" valign="top">
<select name="SelectedItem" style="width:100%" id="SelectedItem" size="12" multiple="true">
<option>姚明</option>
<option>刘翔</option>
<option>李小双</option>
<option>刘德华</option>
<option>黎明</option>
<option>张学友</option>
<option>王晶</option>
<option>张艺谋</option>
<option>郑秀文</option>
<option>杰克逊</option>
</select>
</td>
<td align="center" valign="top"><br/>
<br/>
<br/>
<br/>
<button onClick="MoveSingleItem(WaitSelectItem, SelectedItem)" class="bn"><<</button>
<br/>
<br/>
<br/>
<button onClick="MoveSingleItem(SelectedItem, WaitSelectItem)" class="bn">>></button></td>
<td valign="top"><select name="WaitSelectItem" style="width:100%" size=12 multiple="true">
</select></td>
</tr>
<tr>
<td align="center" colspan="5"> </td>
</tr>
<tr>
<td align="center" colspan="5">
<input type="button" name="chooseOk" class="bn" value="确 定" onClick="re(WaitSelectItem);"/>
<input type="button" name="reset" class="bn" value="取 消" onClick="javascript:window.close();"/></td>
</tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
function MoveSingleItem(sel_source, sel_dest){
if (sel_source.selectedIndex==-1){
if(sel_source.options.length>0){
var SelectedText = sel_source.options[sel_source.options.length-1].text;
var objItemValue = sel_source.options[sel_source.options.length-1].value;
sel_source.options.remove(sel_source.options.length-1);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}else{
for(var i = sel_source.options.length-1; i >= 0; i--){
if (sel_source.options[i].selected == true) {
var SelectedText = sel_source.options[i].text;
var objItemValue = sel_source.options[i].value;
sel_source.options.remove(i);
sel_dest.options.add(new Option(SelectedText,objItemValue));
}
}
}
}
function re(sel_dest){
window.returnValue=getSelectedValue(sel_dest);
window.close();
}
function getSelectedValue(sel_dest){
var arr = new Array();
for(var i = sel_dest.options.length-1; i >= 0; i--){
arr[i] = sel_dest.options[i].value;
}
return arr;
}
function removeOption(sel){
sel.options.remove(0);
}
</script>
相关文章推荐
- 经典js代码 实现动态传值 实现动态页面传值 options动态显示数据
- 动态的把数据显示在table中,点击某一行的删除按钮实现该行的删除(通过ajax实现页面的无刷新加载)
- 【原创】ExtJs实现定时读取数据,动态加载数据,页面不刷新。Struts 2框架下JSON传值
- 动态的把数据显示在table中,点击某一行的删除按钮实现该行的删除(通过ajax实现页面的无刷新加载)
- echarts实现一个页面同时显示多个不同形状的图表/动态往图表中存放数据
- asp.net Mvc中实现在View页面中嵌入公用动态数据,实现方法为:include(包含动态页面数据)
- js实现动态获取系统时间,显示到页面上
- jquery滚动组件(vticker.js)实现页面动态数据的滚动效果
- angular实现页面数据动态加载
- 图书购买系统之商品分类分页--根据主页面传来的值分类显示商品并实现动态分页功能
- php录入页面中动态从数据库中提取数据的实现
- JSP页面中利用dtree动态显示map数据
- 利用JQuery+Ajax实现aspx页面无刷新的动态数据绑定
- Highcharts AJAX JSON JQuery 实现动态数据交互显示图表 柱形图
- JfreeChart实现数据的实时动态曲线显示
- ThinkPHP定时ajax获取后台数据,使用javascript动态修改前端页面的表格来显示数据
- 基于ArcGIS Server的ADF的异步回调机制实现基于动态数据显示问题
- Web页面实现后台数据处理进度与剩余时间的显示
- jquery将数据以table的形式显示,实现数据统计,分页,以及动态添加,搜索
- MVC4中AJAX Html页面打开调用后台方法实现动态加载数据库中的数据