He�s trying to get the count inside the nested list loop not the cfoutput of
the query

   _____  

From: Nando [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 28, 2004 1:21 AM
To: CF-Talk
Subject: Re: CFLoop question...

Charles,

Don't forget that any query object has a few variables built into it
that you can make use of, RecordCount, the total number of records in
a query, and CurrentRow - the current one.

Here's a guess at a query loop that might be helpful in your case.
Adapt to suit your need.

<cfoutput>
Select a name from one of these #q_Names.RecordCount# choices
<select name="fields" size="10" multiple>
    <cfloop query="q_Names">
      <option value="#q_Names.name#">#q_Names.name# --
#q_Names.CurrentRow#</option>
    </cfloop>
</select>
</cfoutput>

On Sat, 28 Aug 2004 00:32:02 -0400, Charles Heizer <[EMAIL PROTECTED]> wrote:
> 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:176261"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=36" \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]

Reply via email to