Nator
Oct 29th, 2001, 02:53 PM
This may be incredibly easy, but for some reason I can't find a lot of documentation on the add method. I have two listboxs that I want to allow the user to move items from one box to the other.
At the same time the user is moving an item from one box to the other, I want the "moving" item to be removed from it's previous listbox.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function button1_onclick() {
for(i=0; i<frmBlah.select1.options.length; i++)
if (frmBlah.select1.options[i].selected);
frmBlah.select2.add ??????
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM ID=frmBlah>
<P><SELECT id=select1 style="WIDTH: 108px; HEIGHT: 193px"
size=2 name=select1 multiple> <OPTION value="Item 1"
>Item 1</OPTION><OPTION value="Item 2"
>Item 2</OPTION><OPTION
value="Item 3"
>Item 3</OPTION><OPTION value="Item 4"
>Item 4</OPTION></SELECT><INPUT id=button1 type=button value=Add name=button1 LANGUAGE=javascript onclick="return button1_onclick()"><INPUT id=button2 type=button value=Remove name=button2><SELECT
id=select2 style="WIDTH: 180px; HEIGHT: 192px" size=2 name=select2>
<OPTION></OPTION></SELECT></P></FORM>
</BODY>
</HTML>
Thanks.
At the same time the user is moving an item from one box to the other, I want the "moving" item to be removed from it's previous listbox.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function button1_onclick() {
for(i=0; i<frmBlah.select1.options.length; i++)
if (frmBlah.select1.options[i].selected);
frmBlah.select2.add ??????
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM ID=frmBlah>
<P><SELECT id=select1 style="WIDTH: 108px; HEIGHT: 193px"
size=2 name=select1 multiple> <OPTION value="Item 1"
>Item 1</OPTION><OPTION value="Item 2"
>Item 2</OPTION><OPTION
value="Item 3"
>Item 3</OPTION><OPTION value="Item 4"
>Item 4</OPTION></SELECT><INPUT id=button1 type=button value=Add name=button1 LANGUAGE=javascript onclick="return button1_onclick()"><INPUT id=button2 type=button value=Remove name=button2><SELECT
id=select2 style="WIDTH: 180px; HEIGHT: 192px" size=2 name=select2>
<OPTION></OPTION></SELECT></P></FORM>
</BODY>
</HTML>
Thanks.