hazelsisson
Programmer
Hi guys,
here's an annoying problem that you may be able to help me with:
I have two multiple select boxes side by side, which can have options swapped by clicking on an "add" or "remove" button.
The problem is if nothing is selected and "add" or "remove" is pressed an error shows, which is "Object doesn't support this property or method". Here's the code:
Let me know if you want to see any of the other code. (I haven't got the name of the form wrong!)
Thank-you!
Hazel
here's an annoying problem that you may be able to help me with:
I have two multiple select boxes side by side, which can have options swapped by clicking on an "add" or "remove" button.
The problem is if nothing is selected and "add" or "remove" is pressed an error shows, which is "Object doesn't support this property or method". Here's the code:
Code:
function addValue()
{
var theIndex;
var theIndex = document.normForm.normUsers.selectedIndex;
if (theIndex == -1 )
{
alert("You have not selected anything to move!");
}
else
{
//put option in other select box:
...
}
}
<SELECT SIZE="6" NAME="normUsers" MULTIPLE="Yes" onDblClick="addValue();">
(Options are dynamically generated)
</SELECT>
<INPUT TYPE="BUTTON" NAME="addButton" VALUE="->" onClick="addValue();">
Thank-you!
Hazel