Generate Radio Button from form_factory

34 views
Skip to first unread message

Yannick

unread,
Jul 3, 2009, 11:55:30 AM7/3/09
to web2py Web Framework
Hello mate,
I have a stupid question here...Just wonder can I generate a radio
button form from an SQLField using form_factory ? (The radio button
should be True or False)
Does anyone know how ? I tried different parameter in SQLField like
'boolean' etc.. but can't have radio button work... I think it's
something pretty simple that I missed...

Thanks,
Yannick P.

mdipierro

unread,
Jul 3, 2009, 12:37:21 PM7/3/09
to web2py Web Framework
I think this will do.

form=SQLFORM.factory(SQLField('name',requires=IS_IN_SET
(('True','False')),widget=SQLFORM.widgets.radio.widget))
Reply all
Reply to author
Forward
0 new messages