See http://web2py.com/books/default/chapter/29/7#Custom-forms. You can also 
take this approach: 
http://web2py.com/books/default/chapter/29/7#SQLFORM-in-HTML, though if you 
want to use the session (which enables CSRF protection), you'd also have to 
add:

<input type="hidden" name="_formkey" value="{{=form.formkey}}" />

Anthony

On Wednesday, July 18, 2012 9:31:38 AM UTC-4, adohertyd wrote:
>
> I have a form that is generated in the controller as follows:
>
> form = FORM(
>             INPUT(_name='query', requires=IS_NOT_EMPTY()),
>             INPUT(_type='submit'))      
>     if form.process().accepted:
>         session.term=request.vars.query
>         redirect(URL('results_page'))
>     else:
>         response.flash = 'please enter a query'
>     return dict(form=form)
>
> I call it in the HTML page by just typing {{=form}}
>
> My form is simply one input field with a submit button. I want to have the 
> bar centred on the page, with the submit button below it, and under the 
> submit button, a number of radio buttons. I want the data in the form to be 
> submitted as I have it, but also the radio buttons to pass 'true' if 
> selected and 'false' if not selected. Can anyone help me with this?
>

-- 



Reply via email to