That does make sense, now if only I can get my code to work so that I can
see what happens with the table.
*CONTROLLER:*
def index():
return dict()
def form1():
numdays = int(request.vars.name);
forms = [SQLFORM(db.post,formname='form%i' % k) for k in range(numdays)]
for k,form in enumerate(forms):
if form.accepted:
print k, form.vars # or do something else
return dict(forms = forms)
*VIEWS:*
*index.html*
<form enctype="multipart/form-data" action="{{=URL('default', 'form1')}}"
method="post">
Value: <input name="name" /> <input type="submit" />
</form>
*form1.html*
<center>{{=BEAUTIFY(forms)}}
</center>
This creates individual SQLFORMS dynamically based on the value entered in
index.html, therefore each instance of the form that is displayed on the
form has a submit button. The ticket that I get after filling out any
instance is:
numdays = int(request.vars.name):
<type 'exceptions.TypeError'> int() argument must be a string or a number,
not 'NoneType'>
If anyone can point me in the right direction in how to fix this, I would
be very grateful!
--
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/d/optout.