Here, the county will be the number of loops
<select name="fields" size="10" multiple>
<cfoutput query="q_Names">
<cfset county = "1">
<cfloop index="foo" list="#q_Names.name#" delimiters=",">
<option value="#foo#">#foo# -- #i#</option>
<cfset county = county + 1>
</cfloop>
</cfoutput>
</select>
Use QueryName.CurrentRow to get the current row number from your query
_____
From: Charles Heizer [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 28, 2004 12:32 AM
To: CF-Talk
Subject: CFLoop question...
Hello,
I've been trying to do something I would have thought to be easy but it does
not appear so.
I have a list of names and I loop through them with the cfloop command to
put them in to a form select tag, but I also want to know what
possition(count) I'm at.
Example --
<select name="fields" size="10" multiple>
<cfoutput query="q_Names">
<cfset i = "1">
<cfloop index="foo" list="#q_Names.name#" delimiters=",">
<option value="#foo#">#foo# -- #i#</option>
<cfset i = #i# + 1>
</cfloop>
</cfoutput>
</select>
I hope this makes sense.
Thanks,
- Charles
_____
[HYPERLINK "http://www.houseoffusion.com/lists.cfm/link=t:4"Todays Threads]
[HYPERLINK "http://www.houseoffusion.com/lists.cfm/link=i:4:176258"This
Message] [HYPERLINK
"http://www.houseoffusion.com/lists.cfm/link=s:4"Subscription] [HYPERLINK
"http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=678.598.4"Fast
Unsubscribe] [HYPERLINK "http://www.houseoffusion.com/signin/"User Settings]
[HYPERLINK
"https://www.paypal.com/cgi-bin/webscr?amount=&item_name=House+of+Fusion&bus
iness=donations%40houseoffusion.com&undefined_quantity=&cmd=_xclick"Donation
s and Support]
_____
HYPERLINK "http://www.houseoffusion.com/banners/view.cfm?bannerid=40" \n
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 8/27/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 8/27/2004
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

