If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > dynamic dropdown list within loop problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-04, 14:31
-Dman100- -Dman100- is offline
Registered User
 
Join Date: Jan 2004
Posts: 124
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-
Reply With Quote
  #2 (permalink)  
Old 12-03-04, 16:32
-Dman100- -Dman100- is offline
Registered User
 
Join Date: Jan 2004
Posts: 124
Please disregard...I found the problem.

I needed to add
rsName.Requery

Thanks,
-Dman100-
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On