$().ready(function() {
$('#add').click(function() {
return !$('#select1 option:selected').remove().appendTo('#select2');
});
$('#remove').click(function() {
return !$('#select2 option:selected').remove().appendTo('#select1');
});
});
These two functions move selected options from one multiple select to another. I need to make a list with all added options' values(in #select2) in a input type hidden. And this input should be updated each time one of these functions is called.
This should help
Removing is analogous:
I hope this is what your were aiming for..