Click below buttons to move selected options right or left.
|
|
|
<script><br />
function listboxMoveacross(sourceID, destID) {<br />
var src = document.getElementById(sourceID);<br />
var dest = document.getElementById(destID);<br />
for(var count=0; count < src.options.length; count++) {<br />
if(src.options[count].selected == true) {<br />
var option = src.options[count];<br />
var newOption = document.createElement("option");<br />
newOption.value = option.value;<br />
newOption.text = option.text;<br />
newOption.selected = true;<br />
try {<br />
dest.add(newOption, null); //Standard<br />
src.remove(count, null);<br />
}catch(error) {<br />
dest.add(newOption); // IE only<br />
src.remove(count);<br />
}<br />
count--;<br />
}<br />
}<br />
}<br />
</script>