Four things you need to know about Recaptcha
Working on a project where we needed a (slight) proof of humaness, and we opted to use Recaptcha as it has a fairly simple integration with .NET.
Was fine until we wanted to use custom styling to tie in with the site which is when the fun started! A few hours later, after downloading the project’s sample app, I found some things out that I thought I’d share with you…
- The Recaptcha control must be positioned after the
recaptcha_image
div andrecaptcha_response_field
- The killer: your recaptcha_response_field must have a name attribute of
recaptcha_response_field
as well as its id - otherwise Recaptcha won’t see it. - You can specify your public/private key in the web.config AppSettings rather than against the control;
RecaptchaPublicKey
andRecaptchaPrivateKey
respectively. - You can turn off Recaptcha validation either by setting the
SkipRecaptcha
property of the control orRecaptchaSkipValidation
.
The first two are the most important to getting Recaptcha to work with custom styling; I know the properties are documented on the control, but I managed to miss them for a couple of hours so I thought others might do the same.