Page 1 of 1

Coldfusion Arrays

Posted: Tue Nov 28, 2006 11:36 am
by shiznatix
Ok so I have to use coldfusion right now for a bit. I am trying to make a form array thingy like this:

Code: Select all

<input type="checkbox" name="DelImage[]" value="#id#" />
well ok but now how do I loop though all of those and do something there? I have tried every variation of this:

Code: Select all

<cfloop item="NextId" collection="#Form.DelImage#">
//code here! #NextId# should be the value of that checkbox thingy.
</cfloop>
Can anyone help me please?

Posted: Tue Nov 28, 2006 1:39 pm
by shiznatix
screw it, coldfusion sucks

Posted: Tue Nov 28, 2006 3:42 pm
by Burrito
shiznatix wrote:screw it, coldfusion sucks
mmmhmm.

I don't know about the array thing, but I know that if you give the checkboxes the same name (without the []), it will pass all that are checked as a comma separated list. you could then split that list and <cfloop> over the list to do what you want.