[web2py] Re: manual form and SQLFORM question

2015-12-21 Thread Anthony
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

[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread xmarx
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,

[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread Anthony
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!' >

[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread xmarx
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

[web2py] Re: manual form and SQLFORM question

2015-12-20 Thread Pierre-Antoine Roiron
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