[web2py] Re: Dynamically create form ?

2012-03-29 Thread bussiere adrien
Find i've adapted an exemple : form=FORM("UserName:", INPUT(_name='Username'), "Email : ", INPUT(_name='email',_value=user.email), INPUT(_type='submit')) form.insert(-1,INPUT(_name='titi',_value='titi')) the doc : Sometimes you may wish to add an extra element to your form af

[web2py] Re: Dynamically create form ?

2012-03-29 Thread Anthony
More generally, all web2py HTML helpers (including FORM and SQLFORM) act like Python lists with respect to their components, so you can use all the Python list methods, including .insert and .append. Helpers also act like Python dictionaries with respect to their attributes (i.e., named argumen

[web2py] Re: Dynamically create form ?

2012-03-29 Thread Massimo Di Pierro
yes. A helper (a FORM) acts as a list. You can append(), insert() and del its elements. So this: form.add("%s : "%l,INPUT(_name="%s"%l)) Should probably be form.append(SPAN(LABEL(I),":",INPUT(_name=l))) On Thursday, 29 March 2012 07:14:01 UTC-5, bussiere adrien wrote: > > is there a way to dy