Do you know of any good way/plugin to do this with jquery or any description on how to approach this effectively.
jQuery multivalue selector
452 views Asked by Andreas At
2
There are 2 answers
0
On
This is how i ended up doing it
Multiple.Move = function (from, to)
{
$('#' + from + ' option:selected').remove().appendTo('#' + to);
}
And some html for the buttons and the select.
<select multiple="multiple" id="available">
<option value="1">BMW</option>
<option value="1">Volvo</option>
<option value="1">Audi</option>
<option value="1">Saab</option>
</select>
<input type="button" value="Add" onclick="Multiple.Move('available', 'selected')" />
<input type="button" value="Remove" onclick="Multiple.Move('selected', 'available')" />
<select multiple="multiple" id="available">
</select>
This seems like what you're looking for:
"Easy Multi-Select Transfer with jQuery"
http://blog.jeremymartin.name/2008/02/easy-multi-select-transfer-with-jquery.html
Quick snippet, assumes you have two select lists ID'd #select 1 and #select2, as well as two buttons with IDs #add and #remove.