Re: [html-formfu] removing element from the form

2010-07-28 Thread rahed
Carl Franks writes: > I'm not sure what's causing that error message, but I'm not sure that > code's exactly what you want. > remove_element() returns the element that's removed - which in this > case will be stringified and inserted into the template. > > If you don't want the field printed, the

Re: [html-formfu] removing element from the form

2010-07-28 Thread Carl Franks
On 28 July 2010 10:16, rahed wrote: > Benjamin Martin writes: > >> 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_paren

Re: [html-formfu] removing element from the form

2010-07-28 Thread rahed
Benjamin Martin writes: > 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

Re: [html-formfu] removing element from the form

2010-07-27 Thread Benjamin Martin
[% 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 "fo