A
ashkaan57
Hi,
I have two listboxes and want to move a set of selcted items from the
listbox on the left moved to the listbox on the right when a button is
pressed:
function RightButton_OnClick()
{
alert('Clicked MOVE button...');
var AvailableLB = document.getElementById("available");
var LinkedLB = document.getElementById("linked");
for (var i=0; i < AvailableLB.length; i++) {
if (AvailableLB.options.selected == true) {
LinkedLB.options[LinkedLB.length] =
new Option(AvailableLB.options.text,
AvailableLB.options.value);
AvailableLB.options = null;
i=i-1;
}
}
return;
}
<select name="available" multiple size="8" id="available">
</select>
<input name="move" type="button"
value=">>",onClick="RightButton_OnClick();">
<select multiple name="linked" size="8" id="linked">
</select>
When I click on the button, nothing.... not even a javascript error
message or the alert I put at the begining.
Your help is much appreciated.
I have two listboxes and want to move a set of selcted items from the
listbox on the left moved to the listbox on the right when a button is
pressed:
function RightButton_OnClick()
{
alert('Clicked MOVE button...');
var AvailableLB = document.getElementById("available");
var LinkedLB = document.getElementById("linked");
for (var i=0; i < AvailableLB.length; i++) {
if (AvailableLB.options.selected == true) {
LinkedLB.options[LinkedLB.length] =
new Option(AvailableLB.options.text,
AvailableLB.options.value);
AvailableLB.options = null;
i=i-1;
}
}
return;
}
<select name="available" multiple size="8" id="available">
</select>
<input name="move" type="button"
value=">>",onClick="RightButton_OnClick();">
<select multiple name="linked" size="8" id="linked">
</select>
When I click on the button, nothing.... not even a javascript error
message or the alert I put at the begining.
Your help is much appreciated.