I think you need to use the radio widget in conjunction with the IS_IN_SET
or IS_IN_DB validator (it creates the radio button options from the
labels/values specified in those validators).
Anthony
On Tuesday, October 11, 2011 10:45:38 AM UTC-4, Web2Py Freak wrote:
>
> am trying to use SQLFORM.f
oh thnx richard its working , and its a radio now but tell me how
can i get its valu when accepted ??
Maybe you need a boolean to use this widget?!
Richard
On Tue, Oct 11, 2011 at 10:45 AM, Web2Py Freak
wrote:
> am trying to use SQLFORM.factory with a widget but its not working :
>
> def booking():
>content=db(db.page.title=='booking').select(db.page.ALL)
>form = SQLFORM.factory(
>
am trying to use SQLFORM.factory with a widget but its not working :
def booking():
content=db(db.page.title=='booking').select(db.page.ALL)
form = SQLFORM.factory(
Field('your_name', requires=IS_NOT_EMPTY()),
Field('your_email'),
Field('like',widget=SQLFORM.widgets
You can use SQLFORM.factory if you don't have a db table. For a radio
button, I suppose you could specify the radio widget for a given field
(see http://web2py.com/book/default/chapter/07#Widgets), or you could build
the HTML manually (review the details
at http://web2py.com/book/default/chapte
when using sqlform-in-html ,do i have to use a table in the db ,,
and how can i create a radio button from there ?
Same as usual -- you have to create a FORM (or SQLFORM) object in the
controller and use form.accepts (or the newer form.process). You can create
the form manually in HTML and just make sure you include the _formname
hidden field
(see http://web2py.com/book/default/chapter/07#SQLFORM-in-HTML),
7 matches
Mail list logo