List Box Issue, Selected results not showing when updating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #1

    List Box Issue, Selected results not showing when updating

    I have a couple list boxes on a form that query a database table for certain values to display in the box. My problem is that the users are able to select multiple options in these list boxes and then save the form to the database. When they come back into the form to make updates the list boxes are only highlighting the one of the options in the list box and i need it to highlight all of the options the user selected.

    Here is the code for one of these boxes.


    Code:
    <td>Analysis Type</td>
    <td><select name=ANALYSIS_TYPE size=4 multiple style="width:280px;height:380px;">
    		 <%
    		sql = "SELECT APP_LIST_VALUE_DESC from  TICKER_APP_LIST_VALUE WHERE APP_LIST_ID = 4 ORDER BY APP_LIST_VALUE ASC  "	  
    		set rs = server.CreateObject("adodb.recordset")
    		rs.Open sql, conn
    		while not rs.eof 
    		Response.Write("<option value='"&rs(0)&"'")
    		if cstr(ANALYSIS_TYPE_UP)=cstr(rs(0)) then
    		 Response.Write (" selected ")
    		end if
    		Response.Write(">"&rs(0))
    		rs.movenext
    		wend
    		rs.close
    		set rs = nothing%>
    	</select>
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    When you look at the code, do all of the selected options have the term "selected" added?

    Jared

    Comment

    Working...