2011/1/28 Anthony <abasta...@gmail.com> > 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. > > Yes, the only place I see this is in chapter #5 http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing I agree with you, and I think we need some explaination about using DOM to forms manipulation.
I dont know if there are any other caveats about it, I did not try the validation but I think it should work very well.