1

Just want to ask this.

I have a jQuery that move listbox item to another listbox. An its working fine the item was remove. Sample: I remove item in listbox A and it was added to listbox B.

But here is now the problem, when I tried to check each item in listbox A, I noticed that all items that was removed was still there. But i can see in my eyes that it was removed. but when I tried to run a code to check each items - all item that was removed was still there.

Please tell me whats the problem with this. Below is my jQuery code

$('#btnRemove').click(
  function (e) {
    $('#lstSelectedCol > option:selected').appendTo('#lstAvailableCol');
    //$(this).remove(); 
     e.preventDefault();
});

1 Answer 1

3

I hope this might help

http://jsfiddle.net/bdMAF/1/

Sign up to request clarification or add additional context in comments.

3 Comments

Have you got firebug/chrome? You can use it's console to log the available items in the list. I've just updated the code and I think it is working properly. You can check it here: jsfiddle.net/bdMAF/2 When you'll click log button, it'll log the items available in the list to the console.
I tried it again in my code and it's not working... By the way I'm using ASP.net listbox -
I think moving ASP.NET listbox item using Jquery is only remove the item but not all attributes i guess

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.