[html-formfu] removing element from the form

Benjamin Martin benjamin at opusvl.com
Tue Jul 27 15:43:20 GMT 2010



> [% txt = form.get_field('field1) %]
>
> [% txt.label %] # shows its label, ok
>
> [% form.remove_element(txt) %] # shows undef error - element not found
>    

I think is not working because to remove an element you need to call 
'remove_element' against the element's 'parent' ... which may not be "form"

Try this:

[% txt = form.get_all_element('field1') %]
[% txt_parent = txt.parent %]
[% txt_parent.remove_element( txt ) %]






More information about the HTML-FormFu mailing list