[html-formfu] combo box equivalent

Carl Franks fireartist at gmail.com
Tue Aug 26 11:20:45 BST 2008


2008/8/26 Malcolm <mjh-formfu at liminalflux.net>:
> 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've added a test for what I think you're describing, and it seems to work okay.
Can you have a look, and let me know if I'm not getting it?

http://code.google.com/p/html-formfu/source/browse/trunk/HTML-FormFu/t/elements/combo_box.t
http://code.google.com/p/html-formfu/source/browse/trunk/HTML-FormFu/t/elements/combo_box.yml

Cheers,
Carl



More information about the HTML-FormFu mailing list