Not sure if you are asking this:

INPUT(_id='id_x',_name='id_x',_class='id_x',_type='string')

you can also do:

form=SQLFORM.factory(*[Field(name,label=label) for name,label in
myElem])

it will create the 'id' and 'class' following web2py convention so
that you do not have to make up your own.

Massimo


On Sep 10, 10:08 pm, Denis <[email protected]> wrote:
> Hello,
>             I am well versed in Python but a newbie in web2py.
>
> I have a list of elements and I'd like to generate INPUTs for it using
> a for loop if possible
>
> Specifically
>
> myElem = [ ['id_x', 'One'], ['id_y', 'Two'], ['anotherId',
> 'SomeValue']]
>
> should become
>
> <form>
> <input .... id='id_x' ....> One <br />
> <input ... id='id_y' ...> Two <br />
> <input ... id='anotherId'...> SomeValue <br />
> </form>
>
> I've played with
> INPUT (.....) for id,label in myElem
> but I cannot figure out the syntax to change it to something like
> INPUT(..), label, BR() for id,label in myElem
>
> I went through the manual but couldn't find anything to help me.
>
> Thanks in advance
>
> Denis Rouleau
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to