[html-formfu] How can I set multiple default values for a Select?

Carl Franks fireartist at gmail.com
Mon Sep 24 19:47:40 GMT 2007


On 24/09/2007, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
> On 9/24/07, Carl Franks <fireartist at gmail.com> wrote:
> > > > > For a Select with the 'multiple' attribute:
> > > > > http://www.mountaindragon.com/html/optmselected.htm it is valid to set
> > > > > 'selected' on many options.  How can I do that in FormFu?
> > > >
> > > > The logic using default() would need to be fixed to accept an arrayref
> > > > of values.
> > > > Patches welcome!
> > >
> > > default() already accepts arrayref - it's a simple accessor.  Then the
> > > question is where it is used?  I can find it myself - so don't bother
> > > to dig too deep if you don't have an answer top of your head.
> >
> > I think it'll be in Element/_Field.pm in sub _process_value()
> >
>
> I found it in lib/HTML/FormFu/Element/Select.pm. A simple patch is
> attached. I can commit it - if you think it is enough.

test file ++

that looks fine - please do commit it!

Carl



More information about the HTML-FormFu mailing list