[html-formfu] Checkboxgroup

Carl Franks fireartist at gmail.com
Fri Nov 16 14:21:42 GMT 2007


On 15/11/2007, Jonas Alves <jonas.alves at gmail.com> wrote:
> On Nov 15, 2007 6:55 PM, Brian Cassidy <brian.cassidy at nald.ca> wrote:
> > Carl Franks wrote:
> > > No, the reason for the Radiogroup is they all have the same name, so
> > > only 1 can be selected.
> > > That doesn't make sense for checkboxes.
> >
> > Actually, it does. Eg.
> >
> > I am (select 1 or more of the following):
> >
> > [ ] Lazy
> > [ ] Boring
> > [ ] Stupid
> > [ ] Totally hawt
> >
> > The above would be a group of checkboxes of the same name, no?
> >
> > -Brian
> >
>
> Exactly. :)

True, although you could do the same with any field type - this
differs from Radiogroup as it would return multiple values, rather
than one.

Anyway, you're welcome to add a Checkboxgroup element.
I would suggest you base it on the Radiogroup element, with similar
template files - though it'll also need a '_prepare_attrs' sub with
multi-value logic similar to that in Select.pm

Carl



More information about the HTML-FormFu mailing list