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 web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/38a3a4ba-7887-415a-8409-f5f28170d178o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CACWMBMNsEm9rXYFhd7e8Bh6jK9wix%2ByUdZ5BunMT%3Dnef92mGPg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAPf%3DStg%3DQEP%2B5VCTBpuohbSVEjY%3DueYvjzBRsJzseQ4nKTBWWA%40mail.gmail.com.
def category():
db.category.name.default = request.args(0)
form=SQLFORM(db.category)
return dict(form=form)
{{extend 'layout.html'}}
{{=form}}
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/38a3a4ba-7887-415a-8409-f5f28170d178o%40googlegroups.com.
--
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 web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CACWMBMNsEm9rXYFhd7e8Bh6jK9wix%2ByUdZ5BunMT%3Dnef92mGPg%40mail.gmail.com.
--
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 web...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/119b2c41-ae90-4684-aaea-3ebc5f6fde53o%40googlegroups.com.
{{extend 'layout.html'}}
{{=form.custom.begin}}
<ul>
<li>{{=form.custom.label.Category_name}}: {{=form.custom.widget.Category_name}}</li>
<li>{{=form.custom.label.Event_id}}: {{=form.custom.widget.Event_id}}</li>
</ul>
{{=form.custom.submit}}
{{=form.custom.end}}
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/119b2c41-ae90-4684-aaea-3ebc5f6fde53o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/119b2c41-ae90-4684-aaea-3ebc5f6fde53o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CACWMBMNN9wGJB-wAGN_OFNE-_Qz2qtPPMioxJ212S7DDcOADVg%40mail.gmail.com.