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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic form

Status
Not open for further replies.

slechols

Programmer
Nov 28, 2001
28
US
I have an instance where I need to return up to 15 records at one time into a single form for a user to update. I think I have the naming of the form elements licked, but I can't get the database to populate the form correctly. It keeps populating the text boxes with the data from the first record only. How can I get it to populated each box with the correct data? Here is a sample of the code.
<%
count=objRS5.recordcount
SESSION(&quot;INDEX&quot;) = count
%>

<html>
<%
i = CInt(Session(&quot;Index&quot;))
j=1
do while j < i+1
%>
<b><font face=&quot;Arial&quot; size=&quot;4&quot;>EIID <%j></font></b>
<p><input type=text name=UDO_<%=j%> value=<%= objRS5(&quot;UDO&quot;) %>>
<p><input type=text name=txt_term_UDO_<%=j%> value=<%= objRS5(&quot;Term_UDO&quot;) %>>
<p><input type=text name=txt_assets_UDO_<%=j%> value=<%= objRS5(&quot;Assets_UDO&quot;) %>>
<p><input type=text name=txt_audit_UDO_<%=j%> value=<%= objRS5(&quot;Audit_UDO&quot;) %>></p>
<%
j = j + 1
loop
%>
 
As a precaution, if you are not do'ing until rs.eof, then I would definately add in an if check for it. Your page will not necessarilly break without it, but you will have a lot of null values and it can get messy.
-Tarwn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top