muliple select list

M

Mark J Fenbers

When using a multi-select list box named "category" on a submitted form,
I can use...

<% response.write "<p>Category = " & Request.Form("category") & "</p>"
%>

which shows me ...

Category = 1, 2, 5

These are the values I expect from my selections. But my question is
how can I put the selected values into an array, or get the values one
at a time?? (What I really want to do is mathematically sum the
selected values as in: var = 1 + 2 + 5.)

I regret that I used to know this and have forgotten, but am working
outside my usual environment and don't have the book nor on-line help to
assist me. All I have for help is this forum, and Google (which hasn't
been much help).

Thanks for the help!

Mark
 
A

Aaron Bertrand [MVP]

Another alternative would be

<%
cat = "1, 2, 5" ' or cat = Request.Form("category")
execute("i = clng(" & replace(cat, ", ", "+") & ")")
response.write i
%>
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top