N
news.tdl.com
Im passing values between SELECT boxs. Once submitted I want to pass the
value to the opening page. It works ok but I only get a single value (last
one) , I need them all. How can I do this.????
<script language="JavaScript">
function assign(aSel, uSel) {
for (i=0;i<uSel.options.length;i++)
if (uSel.options.selected) {
aSel.options[aSel.options.length] = new Option(uSel.options.text,
uSel.options.value);
uSel.options[i--] = null;
}
if (document.layers && !document.getElementById)
history.go(0);
}
function allSelect()
{
List = document.hostform.EmailTo;
for (i=0;i<List.length;i++)
{
List.options.selected = true;
opener.document.updatesForm.emaillist.value = List.options.value;
}
}
</script>
<form name="hostform" method="post" action="" onSubmit="allSelect(); return
false">
<select name="EmailList" size="10" multiple WIDTH=200
STYLE="width: 200px">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<input type="button" name="Submit2" value=">>"
onClick="assign(document.hostform.EmailTo,document.hostform.EmailList)">
<input type="button" name="Submit" value="<<"
onClick="assign(document.hostform.EmailList,document.hostform.EmailTo)">
<select name="EmailTo" size="10" multiple WIDTH=200
STYLE="width: 200px">>
</select>
<input type="button" name="Submit" value="GO"
onClick="allSelect()">
</form>
value to the opening page. It works ok but I only get a single value (last
one) , I need them all. How can I do this.????
<script language="JavaScript">
function assign(aSel, uSel) {
for (i=0;i<uSel.options.length;i++)
if (uSel.options.selected) {
aSel.options[aSel.options.length] = new Option(uSel.options.text,
uSel.options.value);
uSel.options[i--] = null;
}
if (document.layers && !document.getElementById)
history.go(0);
}
function allSelect()
{
List = document.hostform.EmailTo;
for (i=0;i<List.length;i++)
{
List.options.selected = true;
opener.document.updatesForm.emaillist.value = List.options.value;
}
}
</script>
<form name="hostform" method="post" action="" onSubmit="allSelect(); return
false">
<select name="EmailList" size="10" multiple WIDTH=200
STYLE="width: 200px">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<input type="button" name="Submit2" value=">>"
onClick="assign(document.hostform.EmailTo,document.hostform.EmailList)">
<input type="button" name="Submit" value="<<"
onClick="assign(document.hostform.EmailList,document.hostform.EmailTo)">
<select name="EmailTo" size="10" multiple WIDTH=200
STYLE="width: 200px">>
</select>
<input type="button" name="Submit" value="GO"
onClick="allSelect()">
</form>