I don't see why this requires two forms. Just make the db.tests.questions a
list:reference field and display a single table via SQLFORM(db.tests).
You'll get a multi-select box with all the questions as options. If you
prefer checkboxes, you can do:
Field('questions', 'list:reference
thanks Pierre. but i don't think i understand you clearly, sorry.
if i understand you correctly, you say why all checkbox inputs have same
name (q). but they are checkboxes. they must have a same name. i will get
selected inputs with request.post_vars or request.vars.
when i submit first form,
On Sunday, December 20, 2015 at 6:39:45 AM UTC-5, xmarx wrote:
>
>
> def test2():
> if request.vars and request.vars.q:
> selected_questions=request.vars.q
> form=SQLFORM(db.test)
> if form.process().accepted:
> session.flash='Test added!'
>
i want to do this: user selects some of the questions (checkboxes) and
saves them a test (SQLFORM). it doesn't matter how to do this. with or
without form, redirects or in one page.
i was using q's to retrieve selected checboxes,
i did it with jquery. my way:
page1: test.html
select page. i
Hi,
could it be that you don't increment your ? I think that
html doesn't care, but when passing it to python ?
--
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
5 matches
Mail list logo