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 after it has 
been created. For example, you may wish to add a checkbox which confirms 
the user agrees with the terms and conditions of your website:

1.
2.
3.
4.

form = SQLFORM(db.yourtable)
my_extra_element = TR(LABEL('I agree to the terms and conditions'), \
                      INPUT(_name='agree',value=True,_type='checkbox'))
form[0].insert(-1,my_extra_element)


Le jeudi 29 mars 2012 14:14:01 UTC+2, bussiere adrien a écrit :
>
> is there a way to dynamically create a for like :
>
> liste = ["titi","toto"]
>
> form=FORM("UserName:", INPUT(_name='Username'),
>      "Email : ", INPUT(_name='email',_value=user.email),
> )
>
> for l in liste :
>       form.add("%s : "%l,INPUT(_name="%s"%l))
> # and at the end add the submit button :
> form.add(INPUT(_type='submit')) 
>
>
> Reagrds
> Bussiere
>
>
>

Reply via email to