Link to home
Start Free TrialLog in
Avatar of CochiseCounty
CochiseCountyFlag for United States of America

asked on

Multiple select in drop down box in classic ASP

I have a drop down list in classic ASP, I would like to set it to allow multiple selection, and for each selection, enter a record into the sql database, I know how to do it in ASP.net, but now classic ASP. Please help. Thanks

<select size="1" name="dropEmpl" size="20" tabindex="1" style="font-family: Verdana; font-size: 8pt; color: #000080"></p>
           <%
            Do while not rstEMPL.EOF
            If rstEMPL("Last_First_M_Name") = Request.Form("dropEmpl") then
            %>
        <option value ="<%=rstEMPL("Last_First_M_Name")%>" selected><%=rstEMPL("Last_First_M_Name")%></option>
        <%
        Else
        %>
        <option value ="<%=rstEMPL("Last_First_M_Name")%>"><%=rstEMPL("Last_First_M_Name")%></option>
        <%
        End If
        rstEMPL.MoveNext
        Loop
        %>
  </select>
Avatar of Big Monty
Big Monty
Flag of United States of America image

just add the word multiple to the tag:

<select size="1" name="dropEmpl" size="20" tabindex="1" style="font-family: Verdana; font-size: 8pt; color: #000080" multiple>

B.D.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
just to elaborate, doing a

val = Request.Form("dropEmpl")

would set val to a comma delimited string of the values selected. Depending on what you wanted to update, this would be the raw data you would post back to the server.

B.D.