[html-formfu] Why does get_all_elements() return a fake element?

Carl Franks fireartist at gmail.com
Fri Oct 17 17:34:43 BST 2008


2008/10/9  <onken at houseofdesign.de>:
>
>
>
> On Thu, 09 Oct 2008 11:07:04 +1100, Ron Savage <ron at savage.net.au> wrote:
>> Hi Ron
>>
>>> <==8><==>
>>> ron at zoe:~/perl.modules/Local-Contacts/scripts$ ./el.pl
>>> Name: N/A.
>>> Name: sid.
>>> <==8><==>
>>
>> Could it be the fieldset 'element'?
>>
>
> It probably is. If you want to get the sid field only
> try $form->get_all_element({type => 'Hidden'});
> If you want to know which type an element is
> try $element->type.

Just to clarify... If you're wanting to find a field, you should
generally just use get_field() / get_fields() which search
recursively.

get_element() / get_all_elements() are for more detailed introspection
where you need to know what things are attached to what.

Carl



More information about the HTML-FormFu mailing list