cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: Proccesing "normal" form data with flow
Date Wed, 22 Feb 2006 12:31:05 GMT
Le 22 févr. 06 à 08:14, Derek Hohls a écrit :

> ...The problem, though, is how to
> get all the IDs of all checkboxes that have been checked,
> where the total number of checkeboxes and their IDs, vary
> from case to case...

If you cannot use CForms, the easiest IMHO is to use naming  
conventions for your checkboxes - if all checkbox names start with a  
common prefix, you could enumerate the request parameters to find out  
which ones are checked.

The case of unchecked ones is harder, as in that case the parameter  
is simply not present. For that case, I'd add a hidden field which  
allows you to know which checkboxes exist, for example

<input type="hidden" name="cb_group_enum_1"  

So that your flow can have the complete list.

Or, if you have a naming convention, just knowing how many options  
there are might be enough:

<input type="hidden" name="cb_group_count_1" value="3"/>

There are many different tricks to handle that, and it's not specific  
to Cocoon - you might find better solutions around, but that's the idea.

Hope this helps,

View raw message