*The code of my model db.py is:*
db.define_table(
'event_table',
Field('event_name'),
Field('organizer_name'),
)
db.define_table('category',
Field('Category_name',requires=IS_NOT_EMPTY()),
Field('Event_id',db.event_table)
)
*The controller looks like:*
def category():
form=SQLFORM(db.category)
if form.process().accepted:
response.flash='form has accepted'
else:
response.flash='form has errors'
return dict()
*The code for the view (default/category.html) is:*
{{extend 'layout.html'}}
<form action="#" enctype="multipart/form-data" method="post"><ul>
<li>category name: <input name="Category_name"
value="{{=request.args(0)}}"/></li>
<li>event_id type: <input name="Event_id" ></li></ul>
<input type="submit" value="Submit" />
</form>
*(Here I am trying to pass the event id through the request argument of the
URL. But when I submit the form, it says "form has errors". Why is that
happening? I am not able to understand.?*
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/38a3a4ba-7887-415a-8409-f5f28170d178o%40googlegroups.com.