First I would like to thank those of you who replied to my session time out
issue without being condescending. I still am amazed that I actually posted
that question and I feel totally stupid. LOL
Now for my new issue.
I have an edit form that I generate dynamically. There are a total of 10
rows and three columns in this form. What I am doing is, if there is a
record in the table, I pre-fill however many rows that there are records in
the database, and the rest of the rows are blank. I tried using if
statements checking for data in each row, and if there is data show the
pre-filled rows and then spit out the remainder of the rows with blank
fields but everything I tried only produced the rows that had data and
nothing else. Here is what I have.
<!--- Set the start of the second loop by finding out how many records there
are, then add one to the number --->
<cfset newStartCount = (#listCommitteeMembersRet.RecordCount# + 1)>
<!--- Loop through the records --->
<cfloop from="1" to="#listCommitteeMembersRet.recordCount#" index="i">
<tr>
<cfoutput query="listCommitteeMembersRet" maxrows="1" startrow="#i#">
<input type="hidden" name="EC_ID"
value="#listCommitteeMembersRet.EC_ID#" />
<td width="200"><input type="text" name="Name_#i#" value="#Name#"
/></td>
<td width="125"><input type="text" name="Phone_#i#" value="#Phone#"
/></td>
<td><input type="text" name="Email_#i#" value="#Email#" /></td>
</cfoutput>
</tr>
</cfloop>
<!--- Start the next loop showing blank records but keeping the index
incremental. --->
<cfloop from="#newStartCount#" to="10" index="i">
<tr>
<cfoutput>
<td width="200"><input type="text" name="Name_#i#" /></td>
<td width="125"><input type="text" name="Phone_#i#" /></td>
<td><input type="text" name="Email_#i#" /></td>
</cfoutput>
</tr>
</cfloop>
Surely there has to be a more elegant way of doing this?
One thing that I noticed though. in the first loop, if I put to="10", then I
get the X number of rows pre-filled, then I get the remainder of the rows
output but no data like so:
<tr>
</tr>
<tr>
</tr>
And so on until all 10 rows are complete. So I know that it is actually
looping through the rows all 10 times, so there has to be a way to get the
blank records to fill in these rows.
Thanks,
--
Bruce Sorge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264804
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4