.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> JQuery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

add remove items from one listbox to another using JQuery

Posted By:Amit Mehra       Posted Date: March 10, 2010    Points: 10    Category: JQuery    URL: http://www.dotnetspark.com  

add remove items from one listbox to another using JQuery. Here is the solution using JQuery to Add, AddAll, Remove, RemoveAll items from one listbox to another.
 

Sometime in the web application we need to have functionality like move items between two listboxes in asp.net. Here is the solution using JQuery to Add, AddAll, Remove, RemoveAll items from one list box to another.

We are using Jquery appnedTo() method to move the items between two listboxes.

here is syntax to use appendTo if you want to move all items

$("#fromListBox option").appendTo("#toListBox");

If you want to move selected values from one listbox 2 another than the syntax is

$("#fromListBox  option:selected").appendTo("#toListBox");

Full code with asp.net Listbox and button control



    
    
    
    
    



    
  
Delhi Chennai Pune Kolkata Mumbai Bangalore



 


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend