[html-formfu] insert_before/insert_after and nested forms

Tim Rayner tfrayner at gmail.com
Wed Dec 17 16:24:28 GMT 2008


Hi,

I've been trying to use the insert_before() and insert_after() methods
to add a new element to a form that is nested (not that nested
actually, it just has the auto_fieldset thing going on). I can find my
pre-existing elements just fine with get_all_element, but when I try
and insert a new element before or after them I get the "position
element not found" error. Looking at the code it appears that the
insert_* methods only search $self->_elements(), which in my hands
only returns the top-level elements, and doesn't do a recursive
search. Is this by accident or design? I guess I was expecting these
insert_* methods to magically figure out the nesting depth for the new
element based on the position element.

Cheers,

Tim Rayner



More information about the HTML-FormFu mailing list