[html-formfu] Bug in get_element: fails to work when auto_fieldset is on

Moritz Onken onken at houseofdesign.de
Sun Oct 5 15:51:31 BST 2008


>
> A statement like   my $s = $form->get_element({type=>'Select'});  
> will return nothing.
> However, if I remove the auto_fieldset above, the return will be  
> correct.
>
> My research indicates that the bug is in the _get_elements routine,  
> around line 50.
> If auto_fieldset is on, then $elements is an array with ONE element  
> (the fieldset), which
> contains a hash, which contains the array of more elements (the  
> input field, the checkboxes,
> and the select). The grep only operates on the outermost array,  
> therefore it fails
> to produce the correct result.
>
> When auto_fieldset is not on, the $elements contains the fields  
> directly, without the fieldset, and
> the result is correct.
>
> I think some kind of a recursive descent into the fieldsets will  
> have to be implemented...

Hi,

try $form->get_all_element. This will look at the entire element tree  
and just
at the first level like $form->get_element does.

greets,

moritz



More information about the HTML-FormFu mailing list