i can get one but I need them all

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>
 
K

kaeli

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.????


You don't. That defeats the purpose of a SELECT element.
If you wanted them all for some reason, you could write the values to
hidden elements, which would be submitted with the rest of the form.
Or you could make a select element that can select more than one option
and select all the options before form submission, but I think hidden
elements would be easier to implement.

-------------------------------------------------
~kaeli~
Why do people who know the least know it the loudest?
If that cell phone was up your a$$, maybe you could
drive a little better!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top