On Thursday, January 27, 2011 12:53:34 PM UTC-5, rochacbruno wrote:
>
> *Manipulation of the SQLFORM object*
> {{=form.elements()[0].insert(0,LABEL('test:',INPUT(_type='text')))}}
> or in a more comprehensive way
> {{=form.elements('form tr td')[0].insert(0,INPUT())}}
>
Altering forms via server-side DOM manipulations should be documented in the
book. It seems to come up a lot, but I don't think it's all that obvious or
explicit in the book. The Views chapter (ch. 5) discusses HTML helpers and
server-side DOM generally, but I don't think there's any discussion of using
these methods specifically to customize forms (because FORM and SQLFORM are
discussed in ch. 7, it's not immediately obvious that they are also HTML
helper objects and can therefore be manipulated in the same way). Examples
of this probably belong in the "Custom forms" section (
http://web2py.com/book/default/chapter/07#Custom-forms), or somewhere in ch.
7.
Anthony
- Re: [web2py] Re: Adding fields to the default register form... Vinicius Assef
- Re: [web2py] Re: Adding fields to the default register form... Anthony
- Re: [web2py] Re: Adding fields to the default register form... Vinicius Assef
- Re: [web2py] Re: Adding fields to the default register form... Bruno Rocha
- Re: [web2py] Re: Adding fields to the default register form... Bruno Rocha
- Re: [web2py] Re: Adding fields to the default register form... Vinicius Assef
- Re: [web2py] Re: Adding fields to the default register form... Anthony
- Re: [web2py] Re: Adding fields to the default register form... David J.
- Re: [web2py] Re: Adding fields to the default register form... Bruno Rocha
- Re: [web2py] Re: Adding fields to the default register form... Anthony
- Re: [web2py] Re: Adding fields to the default register form... Anthony
- Re: [web2py] Re: Adding fields to the default register form... Bruno Rocha
- Re: [web2py] Re: Adding fields to the default register form... Anthony

