Re: [web2py] Re: How to pass arguments with a form
Where should I write this. Is it in controller or view On Mon, Jun 8, 2015 at 4:53 AM, Anthony abasta...@gmail.com wrote: If you really need the id's in the URL to which the form is submitted, you can specify the form's action attribute: form = FORM(..., _action=URL(..., vars=dict(question_id=question_id, user_id=user_id)) Alternatively, you could include the question id and user id as hidden fields in the form, in which case, they will be available in request.post_vars within the action to which the form is submitted. In that case, the id's would not appear in the URL. Anthony On Sunday, June 7, 2015 at 8:46:33 PM UTC-4, Chaitu P wrote: Hello, This is my web page. Iam showing the questions using loop. If for example student has answered for 1st question I should be able to save answer for that corresponding id.Also I want to save the student id as well. I would appreciate if someone helps. [image: Inline image 1] On Fri, Jun 5, 2015 at 8:33 AM, JorgeH jorgeh...@gmail.com wrote: can you share the code you have at the moment? or at least a screenshot of the webpage you mention.. On Thursday, June 4, 2015 at 11:26:00 PM UTC-5, Chaitu P wrote: I have a situation where I have several questions displayed on a page and below each of the question there will be a form like student name and email. Once the student clicks on the submit button I want to pass the corresponding question id in the URL. I have seen several examples to pass arguments through a hyperlink. But Iam not sure how to do this. Can anyone please please let me know... -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Chaitanya Pochampally -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Chaitanya Pochampally -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How to pass arguments with a form
according to anthony code, it seems to write in controller and then in view just write {{=form}} best regards, stifan -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How to pass arguments with a form
On Tuesday, June 9, 2015 at 4:51:59 PM UTC-4, Chaitu P wrote: Where should I write this. Is it in controller or view It depends on where you define the form. If you create the form using the FORM or SQLFORM helpers in the controller, then that's where you do it. If you create the form using custom HTML in the view, then that's where you do it. Anthony -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How to pass arguments with a form
If you really need the id's in the URL to which the form is submitted, you can specify the form's action attribute: form = FORM(..., _action=URL(..., vars=dict(question_id=question_id, user_id =user_id)) Alternatively, you could include the question id and user id as hidden fields in the form, in which case, they will be available in request.post_vars within the action to which the form is submitted. In that case, the id's would not appear in the URL. Anthony On Sunday, June 7, 2015 at 8:46:33 PM UTC-4, Chaitu P wrote: Hello, This is my web page. Iam showing the questions using loop. If for example student has answered for 1st question I should be able to save answer for that corresponding id.Also I want to save the student id as well. I would appreciate if someone helps. [image: Inline image 1] On Fri, Jun 5, 2015 at 8:33 AM, JorgeH jorgeh...@gmail.com wrote: can you share the code you have at the moment? or at least a screenshot of the webpage you mention.. On Thursday, June 4, 2015 at 11:26:00 PM UTC-5, Chaitu P wrote: I have a situation where I have several questions displayed on a page and below each of the question there will be a form like student name and email. Once the student clicks on the submit button I want to pass the corresponding question id in the URL. I have seen several examples to pass arguments through a hyperlink. But Iam not sure how to do this. Can anyone please please let me know... -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Chaitanya Pochampally -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How to pass arguments with a form
Hello, This is my web page. Iam showing the questions using loop. If for example student has answered for 1st question I should be able to save answer for that corresponding id.Also I want to save the student id as well. I would appreciate if someone helps. [image: Inline image 1] On Fri, Jun 5, 2015 at 8:33 AM, JorgeH jorgeh...@gmail.com wrote: can you share the code you have at the moment? or at least a screenshot of the webpage you mention.. On Thursday, June 4, 2015 at 11:26:00 PM UTC-5, Chaitu P wrote: I have a situation where I have several questions displayed on a page and below each of the question there will be a form like student name and email. Once the student clicks on the submit button I want to pass the corresponding question id in the URL. I have seen several examples to pass arguments through a hyperlink. But Iam not sure how to do this. Can anyone please please let me know... -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Chaitanya Pochampally -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to pass arguments with a form
can you share the code you have at the moment? or at least a screenshot of the webpage you mention.. On Thursday, June 4, 2015 at 11:26:00 PM UTC-5, Chaitu P wrote: I have a situation where I have several questions displayed on a page and below each of the question there will be a form like student name and email. Once the student clicks on the submit button I want to pass the corresponding question id in the URL. I have seen several examples to pass arguments through a hyperlink. But Iam not sure how to do this. Can anyone please please let me know... -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.