The example was incorrect because uses an old file with bugs. You should use the Recaptcha helper built in web2py. I fixed the example
http://www.web2py.com/AlterEgo/default/show/99 On Oct 9, 2:26 pm, devnull <ache...@gmail.com> wrote: > The controller below initially displays the flash 'some other error in > your form' right when the page loads. > > If I leave the captcha field blank and hit submit, it flashes 'done!' > The same thing happens if I type something incorrect in the captcha > field and then hit submit. > > What should I do differently? The example > fromhttp://www.web2py.com/AlterEgo/default/show/99 > looks ok to me... (Thanks in advance) > > public_key='(a very long key from reCAPTCHA)' > private_key='(a very long key from reCAPTCHA with a hyphen in it)' > > def cap(): > form=FORM(RECAPTCHA(request,public_key,private_key),INPUT > (_type='submit')) > if form.accepts(request.vars,session): response.flash='done!' > elif form.errors.has_key('captcha'): response.flash='invalid > captcha' > else: response.flash='some other error in your form' > return dict(form=form) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---