I've done this before - as long as we're talking about the same thing. Two <select> elements and you want to move items from one to the other on a button click?
This code excerpt is lifted from an old project of mine and, if used as the event handler of the 'arrow' buttons, should achieve the desired effect. It requires that your <select> elements have id attributes.
In my code I included two versions of the function: moveItemFromListAtoListB and moveItemFromListBtoListA, swapping the source and dest lists in each one. You could also pass the two lists (or their ids) to a single function as parameters.
function moveItemFromListAtoListB()
{
source = getElementById("[I]source_list's_id[/I]");
dest = getElementById("[I]dest_list's_id[/I]");
for (i = 0; i < source.options.length; i++)
{
o = source.options[i];
if (o.selected)
{
dest.options[dest.options.length] = new Option(o.text, o.value, false, false);
source.options[i] = null;
}
}
}
Let me know if it (still ;-) works!