Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving items in Dual Listboxes

How can I move items from one list box control to another listbox control using JavaScript in ASP.NET?

like image 530
balaweblog Avatar asked Oct 15 '08 09:10

balaweblog


1 Answers

If you're happy to use jQuery, it's very, very simple.

$('#firstSelect option:selected').appendTo('#secondSelect');

Where #firstSelect is the ID of the select box.

I've included a working example here:

http://jsbin.com/aluzu (to edit: http://jsbin.com/aluzu/edit)

like image 51
Remy Sharp Avatar answered Sep 19 '22 05:09

Remy Sharp