Using The Split Variable In Asp

Discussion in 'C#' started by whisper_101, May 30, 2008.

  1. #1
    Hi Everyone

    On an .ASP Webpage I allow users to select more than one option from a list box. To retrieve this information I use the Split Function i.e.

    <%

    strSQL = SELECT APP_JOB FROM TBLAPPLICANTS

    Set RSAPPLICANT = Server.CreateObject("ADODB.Recordset")

    RSAPPLICANT.open strSQL,Conn

    Dim strjob

    strjob = RSAPPLICANT("APP_JOB")

    choice=Split(strjob, ",")

    %>

    For example the user selects two options i.e Freelance, Self-Employed that I can retrieve using the For Next Loop.


    <form id="form1" name="form1" method="post" action="">

    <select name="mnustylisttype" size="4" multiple="MULTIPLE" class="DropdownFields">

    <%
    For i = LBound(choice) TO UBound(choice)

    %>
    <option value="<%=choice(i)%>"><%=choice(i)%></option>
    <%
    Next

    %>
    </select>
    </form>

    The options actually come from a list drlistAPP_TYPE a Table that contains the following:


    1 Freelance
    2 Self-Employed
    3 Contract

    My question is how do I retreive the options selected by the user and the remaining options available in the drlistAPP_TYPE?

    Any help would be good - Thanks Guys
     
    whisper_101, May 30, 2008 IP
  2. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you may try method="get" instead of "post"
     
    Link.ezer.com, Jun 6, 2008 IP
  3. rkstech

    rkstech Active Member

    Messages:
    195
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #3
    do you need the option ID or the value in the option

    as you will need to capture the request.form("mnustylisttype") if the selection is only for 1

    or use checkboxes as they are very easy to do.
     
    rkstech, Jun 9, 2008 IP