(Your message is a bit confusing, but I'll go with what I think you might be 
asking)

Unselected checkboxes are never submitted, so you'll only ever get a list of 
trues.

Set the values of the checkboxes to the id's of the items.

Then you wont need do any looping, you'll just do this:

<cfquery...>
SELECT *
FROM sponsors
WHERE pagename IN (<cfqueryparam value="#Form.pagenames#" list="true"/>)
</cfquery>


(Or something along those lines)


> I have a fairly complex problem I am trying to solve.
> 
> I have a form for creating sponsors.  On this form, the user is given 
> a series of checkboxes for selecting which page(s) they would like the 
> sponsor's advertisement to display.  On submission, the selected check 
> boxes are written to a list which is stored under the sponsor's table 
> in my database, with "true" or "false" for the given pagename in the 
> list(e.g., if I have the pagenames index, birthday, & sports, the list 
> will be output as "true,true,true" if the user chooses all of them).
> 
> I am having difficulty with the output--how would I loop over all the 
> entries in my sponsors table to display only the sponsors where the 
> first list item is "true"?
> 
> I have tried to craft an cfif statement to catch the criterion, but I 
> have not had any luck.  Any ideas?
> 
> Thanks!
> 
> Joel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

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

Reply via email to