hi everybody
I am trying to figure out how to create many forms that are similar on one
page. The idea is to have people comment on various sections of a page with
text. This means that,
each section has its comments. The forms are the same with a comment field
and a submit button.
This is the code i got so far. However it does not work and i definitely
need to understand how this can be achieved in a simple way. Can somebody
help me figure this out.
In controller:
allforms=dict(form_id=new_form_id(),form=SQLFORM(db.manyforms))
for f in allforms:
if f['form'].accepts(request.vars,formname=f['form_id']):
response.flash = 'accepted'
else:
response.flash = 'refused'
return dict(allforms=allforms)
In model:
db.define_table('manyforms',
Field('comment'))
--
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.