Coldfusion Arrays

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Coldfusion Arrays

Post 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?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

screw it, coldfusion sucks
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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.
Post Reply