Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 25th, 2007, 5:15 AM   #1
piercy
Programmer
 
Join Date: Apr 2006
Posts: 35
Rep Power: 0 piercy is on a distinguished road
asp list box to list box transfer JS.

i have two asp list boxs. one on the left is populated by test data eventually going to be data retrieved from the database. the user will select the certain info for instance usernames and then transfer them across to the other box for the web application to read.

ive got two buttons to transfer single or multiple values but i need two more buttons to transfer all between the two. this needs to be javascript as then there is no need to refresh the page.

function MoveItem(ctrlSource, ctrlTarget) { 
var Source = document.getElementById(ctrlSource); 
var Target = document.getElementById(ctrlTarget); 

if ((Source != null) && (Target != null)) { 
while ( Source.options.selectedIndex >= 0 ) { 
var newOption = new Option(); // Create a new instance of ListItem 
newOption.text = Source.options[Source.options.selectedIndex].text; 
newOption.value = Source.options[Source.options.selectedIndex].value; 

Target.options[Target.length] = newOption; //Append the item in Target 
Source.remove(Source.options.selectedIndex); //Remove the item from Source 
} 
} 
}


this is the code i have inplace... then the list has a ondblclick() event and a normal button also has a onclick event. so something i can add into this on a new button to move all would be great. i looked around on net but couldnt find too much.. if some one has a link id be happy to follow that.

Thanks in advance,
Piercy
__________________
this forum rules you guys are great!
thanks to all who help
piercy
piercy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
linked list problems bl00dninja C++ 6 Feb 17th, 2008 10:30 AM
singly-linked list templaste class in C++ w/ example driver bl00dninja Show Off Your Open Source Projects 0 Sep 11th, 2006 1:05 AM
dev c++ software, template problem cairo C++ 11 Jun 2nd, 2006 12:42 PM
User-defined creatNode and deleteNode functions for a doubly-linked list jgs C 2 Apr 28th, 2005 8:53 AM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC