[web2py] Re: Static forms

2011-10-11 Thread Anthony
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

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
oh thnx richard its working , and its a radio now but tell me how can i get its valu when accepted ??

Re: [web2py] Re: Static forms

2011-10-11 Thread Richard Vézina
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( >

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
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

[web2py] Re: Static forms

2011-10-11 Thread Anthony
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

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
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 ?

[web2py] Re: Static forms

2011-10-11 Thread Anthony
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),