Hi there,
It may be a lot easier to use the Split method. This method splits the Request.Form value (or any other string) based on a comma (or any other separator) and returns an array of the items in the string
You can then simply loop through the array, displaying each selected item. The following code shows you how this works:
Code:
<body>
<%
If Request.Form("btnSubmit") <> "" Then
Dim arrSelection
Dim iLoop
Dim iUBound
arrSelection = Split(Request.Form("lstTest"), ",")
iUBound = UBound(arrSelection) ' The last item in the array
' with a zero based index, so an UBound of 2 means 3 items
For iLoop = 0 to iUBound
Response.Write("Selected Item " & arrSelection(iLoop) & "<br />")
Next
End If
%>
<form id="frmTest" name="frmtest" method="post" action="test.asp">
<select name="lstTest" multiple="multiple" size="5">
<option value="1234">1</option>
<option value="2345">2</option>
<option value="3456">3</option>
<option value="4567">4</option>
<option value="5678">5</option>
</select>
<input type="submit" name="btnSubmit" value="submit">
</form>
</body>
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.