Why bother inserting them into the form object if you don't want them 
included in the form at all -- just insert them separately in the view? 
Note, they won't be submitted with the form unless they are inside the 
<form> tag. If you simply want a custom layout with separate divs *within* the 
form, then you can make a custom layout: 
http://web2py.com/books/default/chapter/29/07#Custom-forms

Anthony

On Monday, June 24, 2013 11:19:24 AM UTC-4, Jordan Ladora wrote:
>
>
> Hello,
>
> I have a form where I want to manipulate a couple of extra elements 
> *separately* in the view. 
>
> I'd like to be able to wrap them in a separate <div> element so they are 
> physically on the page somewhere else and not together with the other form 
> fields.
>
> In the controller-
>     form = SQLFORM.factory(fields)
>
>     my_extra_element   = TR(LABEL('Element one'), INPUT(_id='e1', 
> _type='text'))
>     my_extra_element2 = TR(LABEL('Element two'), INPUT(_id='e2', 
> _type='text'))
>     form[0].insert(-1, my_extra_element)
>     form[0].insert(-1, my_extra_element2)
>
> In the view, if I show the form in the usual way-
>
> {{=form}}
>
> ..it shows the elements #e1 and #e2 together with the form, by default, 
> but I want to take them out of here and put them somewhere else-
>
> <div id="d1">
> {{=form}}   # i want to show the whole form except the #e1 and #e2 
> elements here
> </div>
>
> <div id="d2">
> #  I want to put the #e1 and #e2 elements here
> </div>
>
> How can I take #e1 and #e2 out of div #d1 and put them in div #d2?
>
> Thanks for any help!
> -J

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to