JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Dynamic Color Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 

MOVE LIST Script


About
 Javascript list movement script moves data from one listbox to another list box.


Features
a) You can move data from one listbox to another list using this list box movement script.
b) Just copy the code and use it for free.

Preview
From GroupTo Group



Code
Javascript Code
< !-- Script by hscripts.com -->
<script type="text/javascript">
/* ************************* */
//	 Copy the code inside head portion of your HTML code
//   Created on : Nov 12,2007 
//   List movement script
//   Moves the items between two HTML Select elements
//   it looks like a movement between two lists.
//
/* ************************* */
var from_array = new Array('Pink',1,2,'Green',4,'Yellow');  // this array has the values for the source list
var to_array = new Array('Red',3,5); 		  // this array has the values for the destination list(if any)

function moveoutid()
{
	var sda = document.getElementById('xxx');;
	var len = sda.length;
	var sda1 = document.getElementById('yyy');
	for(var j=0; j<len; j++)
	{
		if(sda[j].selected)
		{
			var tmp = sda.options[j].text;
			var tmp1 = sda.options[j].value;
			sda.remove(j);
			j--;
			var y=document.createElement('option');
			y.text=tmp;
			try
			{sda1.add(y,null);
			}
			catch(ex)
			{
			sda1.add(y);
			}
		}
	}
}


function moveinid()
{
	var sda = document.getElementById('xxx');
	var sda1 = document.getElementById('yyy');
	var len = sda1.length;
	for(var j=0; j<len; j++)
	{
		if(sda1[j].selected)
		{
			var tmp = sda1.options[j].text;
			var tmp1 = sda1.options[j].value;
			sda1.remove(j);
			j--;
			var y=document.createElement('option');
			y.text=tmp;
			try
			{
			sda.add(y,null);}
			catch(ex){
			sda.add(y);	
			}

		}
	}	
}
</script>


HTML Code
<table border=1 align=center valign=center>
<tr><td>From Group</td><td></td><td>To Group</td></tr>
<tr><td>
<select id=xxx multiple size=7 style="width:100;">
<script type="text/javascript">
for(var i=0;i<from_array.length;i++)
{
	document.write('<option>'+from_array[i]+'</option>');
}
</script>
</select>
</td>
<td>
<input type=button value=">>" onclick=moveoutid()>
<input type=button value="<<" onclick=moveinid()>
</td>
<td>
<select id=yyy multiple size=7 style="width:100;">
<script type="text/javascript">
for(var j=0;j<to_array.length;j++)
{
	document.write('<option>'+to_array[j]+'</option>');
}
</script>
</select>
</td></tr>
</table>

Release Date - 07-01-2008
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
 a) Copy the above javascript code inside the head portion of your HTML code.
 b) Every list value is stored as array values.
 c) Change the array values with yours.
 d) When the button '>>' is clicked, the function 'moveoutid()' is invoked and when the button '<<' is clicked, the function 'moveinid()' is invoked.
 e) Above functions is used to move data from one listbox to another list box.
 f) Copy the above code into your page and use it.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting