Re: Help with List Comparisons, Output Logic

2007-03-28 Thread Joel Watson
DOH! Part of my problem thus far is that I've been using a flash form which apparently doesn't pass the value of a check box, only the boolean state (and all of them, for that matter, checked or unchecked)... Is this able to be circumvented, or should I adjust the tables which I am creating?

Re: Help with List Comparisons, Output Logic

2007-03-28 Thread Joel Watson
Never mind--I have simply added a hidden ID field in the form's looped section (the one handling the checkbox generation...) Anyway, I set up my database per your suggestion, and it is working brilliantly! I am handling the looped Insert statement like this: feel free to let me know if it

Re: Help with List Comparisons, Output Logic

2007-03-28 Thread Dinner
On 3/28/07, Joel W wrote: Never mind--I have simply added a hidden ID field in the form's looped section (the one The only thing I'd add is that you should probably cfqueryparam those values too... It's easier to forget when doing loops and stuff, but just as needed. /me goes back to

Help with List Comparisons, Output Logic

2007-03-27 Thread Joel Watson
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

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Peter Boughton
(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:

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Joel Watson
Thanks for the response. One of the issues I am running into is that (and I failed to mention this in my original post) the checkboxes are being dynamically generated from another table called Pages. So then, for whatever reason, my list is being written with values for every checkbox,

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Ben Doom
It might make a lot more sense to use another table to store these values, instead of trying to build vague true, true, false lists. You'd store, in addition to the PK for this table (because every table has a PK, right? RIGHT?) the PKs for the page and sponsor that are connected. That is,

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Dinner
Sounds to me like you need a relationship table! Get away from the list of values, and instead use a separate table, with a relation table, which links the two together. For the one-offs (if I'm even using that term right) it's no big deal, but if you're going to be doing a fair bit of stuff

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Joel Watson
Ben, Dinner-- Thank you both for the erudite responses. You have convinced me! Now for the million-dollar question: As mentioned, I am generating the select boxes dynamically from the Pages table. If I am to enter the users inputs from the check boxes, how would I go about parsing out these

Re: Help with List Comparisons, Output Logic

2007-03-27 Thread Ben Doom
If you are returning a POST instead of a GET, I'd name all the checkboxes the same. Make the values the page IDs. You'll get a comma-delimited list which you can parse into a large insert. If you have to name them individually, prefix them with something similar (ie page_(ID) so, page_23,