Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    124

    Unanswered: dynamic dropdown list within loop problem

    created a dynamic list and placed it within a loop. The dynamic list works fine, but when the loop occurs to create a new table row, the dynamic list isn't populated into the new row. Here is a snippet of the code starting at the loop, which includes the code for drop down list:

    <table id="spacing" width="100%" border="0" cellpadding="5" cellspacing="0">
    <%
    Session("url") = 1
    Dim x
    For x = 0 to Session("TotalRowsA")
    %>
    <tr>
    <td><select name="yrA<%=x%>" id="yrA<%=x%>">
    <option>-Select-</option>
    <%
    Do While NOT rsYear.EOF
    Response.Write("<option value=""" & rsYear.Fields.Item("FY_CHAR").Value & """")
    If Session("yrA" & x) = rsYear.Fields.Item("FY_CHAR").Value Then
    Response.Write("selected")
    End If
    Response.Write(">" & rsYear.Fields.Item("FY_CHAR").Value & "</option>")
    rsYear.MoveNext()
    Loop
    %>
    </select></td>
    </tr>
    <%
    Next
    %>
    </table>

    How can I get this dynamic list to populate through each iteration of the loop?
    I trigger the loop by submitting to another page that increments the session("url") value by 1 on each pass of the loop.

    Any help is greatly appreciated.
    Thanks,
    -D-

  2. #2
    Join Date
    Jan 2004
    Posts
    124
    Please disregard...I found the problem.

    I needed to add
    rsName.Requery

    Thanks,
    -Dman100-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •