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
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

