Hie folks..... When I click on submit button of the CUSTOM REGISTRATION
form..... it redirects to the same page...... ?? No idea what this is
about......
Controller: default.py
def register():
form=auth.register()
form.add_button('Cancel', URL('register'))
form=auth.register()
if form.accepts(request.vars,session):
print "did it"
response.flash="Your Registration request has been
successfully submitted"
redirect(URL('home'))
elif form.errors:
response.flash="Errors in form"
else:
response.flash="nothing mah badd"
return dict(late=late, form=form)
View: register.html
{{extend 'layout.html'}}
<a href={{=URL('home')}}>Home</a> ยป Book Connect
<p style="font-family:Times New Roman;font-size:17px;">
We facilitate sharing of books with partner Schools, NGOs, community
centers, and shelter homes.
<br/><br/>
In case you represent any of the above, please register with us as partner
to avail our book sharing program BookConnect. Once registered with us, you
can search through our book repository and request for the books.
</p>
<br/>
{{=form.custom.begin}}
<table>
<tr>
<td style="width:51%;">Name <span
style="color:red;">*</span></td><td> {{=form.custom.widget.Name}}</td>
</tr>
<tr>
<td style="width:51%;">Email <span
style="color:red;">*</span></td><td> {{=form.custom.widget.email}}</td>
</tr>
<tr >
<td style="width:51%">Password <span
style="color:red;">*</span></td><td> {{=form.custom.widget.password}}</td>
</tr>
<tr>
<td style="width:45%">Address <span
style="color:red;"></span></td><td> {{=form.custom.widget.Address}}</td>
</tr>
<tr>
<td style="width:45%">Contact Person <span
style="color:red;"></span></td><td>{{=form.custom.widget.Contact_person}}</td>
</tr>
<tr>
<td style="width:45%">Contact No 1 <span
style="color:red;">*</span></td><td>{{=form.custom.widget.Contact_No_1}}</td>
</tr>
<tr>
<td style="width:45%">Contact No 2 <span
style="color:red;"></span></td><td>{{=form.custom.widget.Contact_No_2}}</td>
</tr>
<tr>
<td style="width:45%">Description <span
style="color:red;"></span></td><td>{{=form.custom.widget.Description}}</td>
</tr>
<tr>
<td
style="width:45%">Website </td><td>{{=form.custom.widget.Website}}</td>
</tr>
<tr>
<td style="width:40%">Date of
Request</td><td>{{=form.custom.widget.Date_of_request}}</td>
</tr>
<tr style="visibility:hidden"><td
style="width:40%">Status</td><td>{{=form.custom.widget.Date_of_request}}</td></tr>
<tr><td>{{=form.custom.submit}}
<!--a class="btn btn-default"
href={{=URL('donate_book')}}>Cancel</a--></td></tr>
</table>
{{=form.custom.begin}}
print form.errors -> <Storage {}>
pritn form.accepts(request.vars,session) -> false
--
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/groups/opt_out.