As I said: I solved this problem building the form in form_factory.
trainingrows=db().select(db.bedrijftraining.training,distinct=True)
traininglist=[trainingrows[i]['training'] for i in range(len
(trainingrows))]
form=form_factory(SQLField('training', label='Selecteer een
activiteit',requires=IS_IN_SET(traininglist)))
The IS_IN_SET() list is based on a database table, now I would like to
convert the following form into a IS_IN_SET() list:
<select name="dagen">
<option value="14" selected="selected">2 weken</option>
<option value="28">4 weken</option>
<option value="56">8 weken</option>
</select>
And use the list like this:
dayslist[]
form=form_factory(SQLField('dagen', label='Selecteer een aantal
weken',requires=IS_IN_SET(dayslist)))
I searched this group for an answer, but didn't find a solution with
respect to label/value pairs.
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
-~----------~----~----~----~------~----~------~--~---