def index(): forms = [SQLFORM(db.table,formname='form%i' % k).process() for k in range(10)] for k,form in enumerate(forms): if form.accepted: print k, form.vars # or do something else return dict(forms = DIV(*forms))
On Wednesday, 13 January 2016 10:58:02 UTC-6, aetagot...@gmail.com wrote: > > I'm not sure if this is even possible, but if it is..how would something > like this work: > > You prompt the user for an x amount of days, then with javascript and > jquery you have x amount of buttons appear. Each button is an instance of > the form. There is a variable within the javascript that holds the amount > x. So for each instance of x, the user fills out the same form but with > different values for each day. In the db module containing the sqlform, > there is a function that takes in each instance and performs what it needs > to for each separate instance. > > Also, if you are in views, how can you share a variable that is used in a > script to python code in the same views, or in the db models file? > -- 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.