That worked. Thanks. :)

Dominic Watson wrote:
> Ah, sorry I didn't test it!
> 
> You will need to use: position[field][currentRow].
> 
> The currentRow is relative to the query that is being looped (with cfoutput
> or cfloop) so you can use that instead of your count variable.
> 
> Dominic
> 
> 
> 
> 
> On 01/01/2008, Phillip M. Vector <[EMAIL PROTECTED]> wrote:
>> Thanks..
>>
>> When I do that, I get  Complex object types cannot be converted to
>> simple values.
>>
>> When I try the second solution, I get ..
>>
>> cannot convert the value of type class coldfusion.sql.QueryColumn to a
>> boolean
>>
>> Any ideas? :)
>>
>> Dominic Watson wrote:
>>> Hi Philip, instead of doing:
>>>
>>> <cfif 'positions.#Field#' EQ 0>
>>>
>>> Do:
>>>
>>> <cfif positions[field] EQ 0>
>>>
>>> Also, and this is personal preference, you can treat the 1 or 0 values
>> as
>>> booleans so you could also write it as:
>>>
>>> <cfif not positions[field]>...</cfif> or <cfif
>> positions[field]>...</cfif>
>>> Dominic
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 01/01/2008, Phillip M. Vector <[EMAIL PROTECTED]> wrote:
>>>> I'm trying to loop over a list of table columns and use the "selected"
>>>> option on the select tag to set it yes or no based on the value.. But I
>>>> can't seem to figure out how to do this as I can't indent a # within a
>> #
>>>> pair.
>>>>
>>>> Any ideas on how to make the check to see if it's 1 or 0 work?
>>>>
>>>> ===============
>>>>        <cfset count=0>
>>>>        <cfoutput query="Positions">
>>>>                <cfset count=count + 1>
>>>>                <form action="#myself#Admin.ChangePermissions"
>>>> method="post">
>>>>                <tr>
>>>>                        <td>
>>>>                                #position#
>>>>                        </td>
>>>>                        <cfloop index = "Field" list =
>>>>
>>>>
>> "DownloadGames,SeeSchedules,SeeStatus,SetStatus,EnterGames,SeeEmail,Employee,JobSettings">
>>>>                                <td>
>>>>                                        <select name="#Field#_#Count#">
>>>>                                                <option value="1"
>>>>                                                        <cfif
>>>> 'positions.#Field#' EQ 1>
>>>>                                                         Selected
>>>>                                                        </cfif>
>>>>                                                        >Yes
>>>>                                                </option>
>>>>                                                <option value="0"
>>>>                                                        <cfif
>>>> 'positions.#Field#' EQ 0>
>>>>                                                         Selected
>>>>                                                        </cfif>
>>>>                                                        >No
>>>>                                                </option>
>>>>                                        </select>
>>>>                                </td>
>>>>                        </cfloop>
>>>>                        <td>
>>>>                                <input type="Text"
>>>> Name="ListingOrder_#Count#"
>>>> value="#Positions.ListingOrder#" size="3">
>>>>                                <input type="Hidden" Name="ID_#Count#"
>>>> value="#Positions.id#">
>>>>                        </td>
>>>>                </tr>
>>>>        </cfoutput>
>>>>
>>>>
>>>
>>
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295672
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to