muliple select list

Discussion in 'ASP General' started by Mark J Fenbers, Apr 9, 2004.

  1. 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
    Mark J Fenbers, Apr 9, 2004
    #1
    1. Advertising

  2. Never mind, I finally stumbled across the answer I was looking for at
    http://www.brainjar.com/asp/formmail/default3.asp

    Mark

    > 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.)
    >
    Mark J Fenbers, Apr 9, 2004
    #2
    1. Advertising

  3. Another alternative would be

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

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/


    "Mark J Fenbers" <> wrote in message
    news:...
    > 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
    >
    Aaron Bertrand [MVP], Apr 9, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ying

    muliple datagrids on one page.

    Ying, Oct 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    380
  2. Darrel

    updating muliple records

    Darrel, Oct 29, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    444
    Darrel
    Oct 30, 2004
  3. Replies:
    9
    Views:
    432
    John Saunders
    Dec 11, 2004
  4. Dano
    Replies:
    1
    Views:
    1,774
    Nathan Sokalski
    Feb 11, 2006
  5. Ken Adams
    Replies:
    0
    Views:
    332
    Ken Adams
    Feb 3, 2005
Loading...

Share This Page