This works:
grid_form =
FORM(INPUT(_type="submit",_name="testsubmit",_value="testsubmit"),grid,INPUT(_type="submit",_name="testsubmit1",_value="testsubmit1",_class='btn'),
)
That is, adding the submit button before the grid works (the second button
still doesn't work)
On Tuesday, 24 December 2013 09:39:36 UTC+11, Tim Richardson wrote:
>
> def test_form():
> grid = SQLFORM.grid(db.person,
> links=[dict(header='field1',body=lambda row: INPUT
> (_type='text',value='123',_name='field1 %s ' % row.id))])
>
> grid_form = FORM(grid,INPUT(_type="submit",_name="testsubmit",_value=
> "testsubmit"))
>
> if grid_form.accepts(request,session):
> print "submit successful" #never happens
>
> return dict(form=grid_form,simple_form=simple_form)
>
>
> In the grid_form, the submit button doesn't submit anything and
> grid_form.accepts() is therefore never true.
> It works if I replace grid_form with a simple FORM (the example for FORM
> in the book).
>
> This is with trunk, on os x, python 2.7.6
>
> The HTML looks fine. I am using a simple view {{=form}}
>
>
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.