Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-selection dropdown list does not work

Status
Not open for further replies.

leifoet

Technical User
Jan 31, 2016
206
BE
From a database tableA with fields: AA (numeric 1 or 0) and BB (1 or 0) and Name, I am trying to create a drop-down list with multiple selection options of the fields AA and BB separately.
So I do not only want to make a selection of the complete record(s) but - if possible - also a separate selection of the fields AA or BB (for example a selection of only BB1 and AA15 and BB27 ...).

AA1 BB1 Name 1
AA2 BB2 Name 2
AA3 BB3 Name 3
...
AA50 BB50 Name 50

Thanks for tips to make the code below workable for this.


Code:
<select multiple NAME="Rec_Id">
<%
Do While Not rs.EOF
%>

	<%if rs("AA")=1 Then%>
		<option value="<%=rs("AA")%>"> 
		<%V_AA="&nbsp;AA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "%>

	<%else%>
		<option style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color:red;"  value="<%=rs("AA")%>">
		<%V_AA="&nbsp;AA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "%>
	<%end if%>
	
	<%if rs("BB")=1 Then%>
		<option value="<%=rs("BB")%>">  
		<%V_BB=("BB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")%>
	<%else%>
		<option style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color:red;" value="<%=rs("BB")%>">  
		<%V_BB=("BB &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")%>
	<%end if%>
	
<%response.write V_AA&" "&V_BB&"  "&rs("Name")%> 
</option>

<%
rs.MoveNext
Loop
%>
</select>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top