FROM is just a helper (makes <form>...</form>) and it is not much
smarter than that. You can use form_factory or
options=[OPTION(k,_value=v) for v,k in db.training.training.options()]
> form=FORM('Type een plaatsnaam:',
> INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
> 'Selecteer een activiteit:'
> SELECT(_name='training',requires=IS_IN_DB
> (db,'training.training','%(training)s'),*options),
> INPUT(_type='submit'))
On Nov 26, 8:42 am, annet <[EMAIL PROTECTED]> wrote:
> In a controller I have got the following code to build a form:
>
> form=FORM('Type een plaatsnaam:',
> INPUT(_name='plaatsnaam',requires=IS_NOT_EMPTY()),
> 'Selecteer een activiteit:'
> SELECT(_name='training',requires=IS_IN_DB
> (db,'training.training','%(training)s')),
> INPUT(_type='submit'))
>
> In my model,
>
> db.bedrijftraining.training.requires=IS_IN_DB(db,
> 'training.training','%(training)s')
>
> results in a drop down list in the admin, I had hoped to achieve the
> same in the form above using the following line of code:
>
> SELECT(_name='training',requires=IS_IN_DB(db,'training.training','%
> (training)s')),
>
> ,however, this line results in an error, does one of you know how to
> implement a drop down list in FORM?
>
> Best regards,
>
> Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---