CochiseCounty
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_Na me")%></op tion>
<%
Else
%>
<option value ="<%=rstEMPL("Last_First_M _Name")%>" ><%=rstEMP L("Last_Fi rst_M_Name ")%></opti on>
<%
End If
rstEMPL.MoveNext
Loop
%>
</select>
<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
%>
<option value ="<%=rstEMPL("Last_First_M
<%
Else
%>
<option value ="<%=rstEMPL("Last_First_M
<%
End If
rstEMPL.MoveNext
Loop
%>
</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
<select size="1" name="dropEmpl" size="20" tabindex="1" style="font-family: Verdana; font-size: 8pt; color: #000080" multiple>
B.D.