Shahzad.Butt wrote:

> How can we loop through only selected checkbox items in action page. I
> dont want to loop through entire items and then use CFIF to check if
> selected then run the statement....

Ifa checkbox is not selected, its value is NOT passed to the action
page... so you can't check to see if it's checked or not.. if the
variable name exists (FORM.yourCheckBoxFieldName), then it is checked.
Assuming you haven't CFPARAM'ed it yet.

Cold Fusion treats the checkboxes with the same name as a comma
separated list.  If your values have commas in them, it gets much more
difficult to loop through them, but otherwise, just use a CFLOOP for a
list (see docs for cfloop).

If you want to loop through all the checkboxes that were checked,
regardless of their name, then you have to name them appropriately (so
cold fusion can tell the difference between checkboxes and other input
fields), and then loop through the FORM struct (again, see docs for
cfloop).  Yuck!

  - Rick
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to