Here's another solution that selects all items from the listbox on the
click of a button.
<html><head>
<script>
function getSelectedItems(oSel) {
var selectedItems = new Array();
for (var i = 0; i < oSel.length; i++) {
if (oSel.options[i].selected)
selectedItems[selectedItems.length] =
oSel.options[i].value;}
return selectedItems;}
</script>
</head>
<body>
<form id="Form1">
<select name="selTest" id="selTest" multiple >
<option value=1>Test1</option>
<option value=2>Test2</option>
<option value=3>Test3</option>
<option value=4>Test4</option>
<option value=5>Test5</option>
<option value=6>Test6</option>
<option value=7>Test7</option>
</select>
<input type="button" id="GetSelectedItems" name="GetSelectedItems"
value="Get Selected Items"
onclick="alert(getSelectedItems(this.form.selTest).join(','));">
</form>
</body></html>
- Todd
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.