Problems with reCaptcha. Using the following code:
*In db.py*:
def captcha_field(request=request):
from gluon.tools import Recaptcha
w = lambda x,y: Recaptcha(request,
'proper public key here ',
'proper private key here ',
error_message='Invalid statement')
return Field('captcha', 'string', label='verify', widget=w,
default='ok')
*In controller:*def contactus():
form = SQLFORM.factory(
Field('name', requires=IS_NOT_EMPTY()),
Field('email', requires =[IS_EMAIL(error_message='invalid email!'),
IS_NOT_EMPTY()]),
Field('subject', requires=IS_NOT_EMPTY()),
Field('message', requires=IS_NOT_EMPTY(), type='text'),
captcha_field(), submit_button='Send', formstyle=bs3.form())
form.custom.widget.email['_placeholder'] = 'email placeholder'
return dict(form=form)
*In view:*{{extend 'layout.html'}}
{{=form}}
Get the following error when formstyle=bs3.form()
<type 'exceptions.IndexError'> list index out of range
If I remove the bs3.form() - everything works. I did not find solution to
this yet. Anyone any ideas?
>
>
>
--
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.