Left and right box data movement

Source: Internet
Author: User




<title> </title>
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" >
-
<link href= ". /.. /css/index.css "rel=" stylesheet "type=" Text/css "/>
<link href= ". /.. /css/leftmenu.css "rel=" stylesheet "type=" Text/css "/>
<link href= ". /.. /css/css.css "rel=" stylesheet "type=" Text/css "/>
<link href= ". /.. /css/dzkutd.css "rel=" stylesheet "type=" Text/css "/>
<script language= "JavaScript" >
function LTrim (str)
{
var whitespace = new String ("\t\n\r");
var s = new String (str);
if (Whitespace.indexof (S.charat (0))! =-1)
{
var j=0, i = s.length;
while (J < i && Whitespace.indexof (S.charat (j))! =-1)
{
j + +;
}
s = s.substring (j, I);
}
return s;
}

function Getobjid (objname) {
for (Var objid=0; ObjID < Window.deptSelectForm.elements.length; objid++)
if (Window.deptselectform.elements[objid].name = = objname) {
return (ObjID);
Break
}
Return (-1);
}

function Appenditem (Allmenu, menu, Isall) {
for (j=0; J<document.getelementbyid (allmenu). length; J + +) {
if (Isall = = True | | document.getElementById (ALLMENU). options[j].selected) {
GET VALUE
document.getElementById (allmenu). options[j].selected = false;
GET LENGTH
Deslen = document.getElementById (menu). length;
NEW OPTION
document.getElementById (menu). Options[deslen] = new Option (LTrim (document.getElementById (allmenu). Options[j].text ), document.getElementById (Allmenu). Options[j].value);
document.getElementById (Allmenu). Remove (j);
j--;
}
}
}
function Turnup () {
for (j=0; J<document.getelementbyid ("resultdept"). Length; J + +) {
if (document.getElementById ("Resultdept"). options[j].selected) {
if (j = = 0) {
Alert ("Please select from the second start");
Return
}
GET VALUE
i = j-1;
var obj = document.getElementById ("Resultdept"). Options[j];
var value = document.getElementById ("Resultdept"). Options[i].value;
var text = document.getElementById ("Resultdept"). Options[i].text;
document.getElementById ("Resultdept"). Options[i].value = Obj.value;
document.getElementById ("Resultdept"). Options[i].text = Obj.text;
document.getElementById ("Resultdept"). Options[i].selected = true;
document.getElementById ("Resultdept"). Options[j].value = value;
document.getElementById ("Resultdept"). Options[j].text = text;
document.getElementById ("Resultdept"). options[j].selected = false;
}
}
}
function Turndown () {
For (J=document.getelementbyid ("Resultdept"). length-1; j>-1; j--) {
if (document.getElementById ("Resultdept"). options[j].selected) {
if (J==document.getelementbyid ("Resultdept"). Length-1) {
Alert ("Please choose from the second from the bottom");
Return
}
GET VALUE
i = j + 1;
var obj = document.getElementById ("Resultdept"). Options[j];
var value = document.getElementById ("Resultdept"). Options[i].value;
var text = document.getElementById ("Resultdept"). Options[i].text;
document.getElementById ("Resultdept"). Options[i].value = Obj.value;
document.getElementById ("Resultdept"). Options[i].text = Obj.text;
document.getElementById ("Resultdept"). Options[i].selected = true;
document.getElementById ("Resultdept"). Options[j].value = value;
document.getElementById ("Resultdept"). Options[j].text = text;
document.getElementById ("Resultdept"). options[j].selected = false;
}
}
}
function ok ()
{

Window.close ();
}
</script>


<body>
<table width= "50%" style= "Border-right:solid 1px #aaccef; Border-bottom:solid 1px #aaccef; Border-top:solid 1px #aaccef; Border-left:solid 1px #aaccef; "cellpadding=" 0 "cellspacing=" 0 "bgcolor=" #f3f8fb "align=" Center ">
<tr height= "30px" >
&LT;TD colspan=4>
<span> Project Query Conditions </span>
</td>
</tr>
<tr>
&LT;TD width= "20%" align= "Center" >
<select id= "initdept" name= "initdept" size= "n" style= "width:150px;" multiple= "true" >
<option value= "1" > Project status </option>
<option value= "1" > Project name </option>
<option value= "1" > Domestic </option>
<option value= "1" > Region </option>
<option value= "1" > Country </option>
<option value= "1" > Construction Area Code </option>
<option value= "1" > Industry code </option>
<option value= "1" > Key industries </option>
<option value= "1" > Business category </option>
<option value= "1" > class five </option>
</select>
</td>
&LT;TD width= "5%" align= "Center" >
<input type= "button" value= "--" onclick= "return Appenditem (' initdept ', ' resultdept ', false);" />
<br>
<input type= "button" value= "==>" onclick= "return Appenditem (' initdept ', ' resultdept ', true);" />
<br>
<br>
<input type= "button" value= "<--" onclick= "return Appenditem (' resultdept ', ' initdept ', false);" />
<br>
<input type= "button" value= "<==" onclick= "return Appenditem (' resultdept ', ' initdept ', true);" />
</td>
&LT;TD width= "20%" align= "Center" >
<select id= "resultdept" name= "resultdept" style= "width:150px;" size= "" multiple= "" true "></select>
</td>
&LT;TD width= "5%" align= "left" >
<input type= "button" value= "Move Up" onclick= "return Turnup ();" />
<br>
<br>
<input type= "button" value= "Move Down" onclick= "return turndown ();" />
</td>
</tr>
<tr height= "30px" >
&LT;TD align= "center" colspan=4>
<input type= "button" name= "Confirm" value= "OK" onclick= "Javascript:ok ()"/>
<input type= "button" value= "Close" onclick= "Javascript:window.close ()"/>
</td>
</tr>
</table>
</body>

Left and right box data movement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.