[html-formfu] Re: problems with Repeatable Select and increment_fields_names = 0

Carl Franks fireartist at gmail.com
Sat Dec 5 22:15:29 GMT 2009


2009/12/4 Doug Orleans <dougorleans at gmail.com>:
> On Tue, Dec 1, 2009 at 5:06 PM, Doug Orleans <dougorleans at gmail.com> wrote:
>> I'm having problems with a Repeatable Select element and
>> increment_fields_names = 0:
>
> Actually the same thing happens with any repeated _Group subclass
> (e.g. Radiogroup).  A patch is below for _Group->prepare_attrs, based
> on some similar code in _Field->_render_value.  Note that it still
> handles the case of a single multi-Select (i.e. with the "multiple"
> attribute) or Checkboxgroup, by checking whether there are multiple
> fields with the same name and leaving the value array alone otherwise.
>  It's possible that some forms could be relying on the current
> behavior with multiple multi-Selects with the same name that have
> disjoint option lists, but this seems unlikely?

Doug,
Many thanks for the patch. I've applied it and added some tests.
I realised that $form->default_values() doesn't have any support at
all for multiple fields with the same name - so that needs fixed next!
:)

Cheers,
Carl



More information about the HTML-FormFu mailing list