[html-formfu] combo box equivalent

Malcolm mjh-formfu at liminalflux.net
Tue Aug 26 04:27:25 BST 2008


On Monday 25 August 2008, Carl Franks wrote:

> > I've been learning my way around FormFu (and Catalyst) recently and
> > wishing they'd been available a few years ago - they make things so much
> > easier. :-)
> >
> > Is there a good way of doing a combo-box type element for a form? I've
> > tried several variations, but so far I haven't found anything that
> > doesn't end up requiring custom coding on the handler.
> >
> > This is the closest I've gotten, but their doesn't seem to be a way of
> > enforcing the SingleValue constraint.
>
> Because Multi is also a Field-element, when you add a constraint to
> it, it doesn't get added to its children, unlike with other Block
> elements.
> If you add the constraint to one of the "country" fields, it should work.

The reason I tried it on the Multi element is that it didn't work on the 
member fields, as there's two child elements with the same name, SingleValue 
fails.

I could name them different things ("country" and "country2" or some such), 
but then I'm back to putting all the logic and error handling for merging 
them, making sure only one is filled out (or they are identical), etc in the 
controller. Given how much cleaner most of the rest of my code has become due 
to FormFu, I was hoping to avoid that.



More information about the HTML-FormFu mailing list