reading multiple select

J

jochen scheire

Hello,

I use a multiple select in a form in an asp page. When I go to the target
page, I want to be able to read out the items selected on the previous page.
How can I do that?

<form method="post" action="compare1.asp" name="Compare">

<select name="motorcycle" multiple size="20">

<%While not RSItems.eof%>
<option
value="<%=RSItems("ID")%>"><%=RSItems("Brand")%>&nbsp;<%=RSItems("Type")%>
<%
RSItems.movenext
wend
%>

</select>
</form>

How can I read out the items selected?

Greetings Jochen
 
B

Bhaskardeep Khaund

Hi,

On the next page, you can request the selected value of the form element normally. You would get you value in a comma separated way, like Option2,Option4,....
Then split the string into an array and then iterate it on to the database....

mortorcycle = Request.Form("motorcycle")
myArr = Split(motorcycle,",")
for i = 0 to uBound(myArr)
....u can access the element by 'myArr(i)'
.........do what ever
Next

Bhaskardeep Khaund
 

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

Staff online

Members online

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,361
Latest member
eitamoro

Latest Threads

Top