Making Google’s reCAPTCHA iframe form HTML 5 valid

Here’s a quick tip on how to make sure Google’s reCAPTCHA form is HTML 5 valid. Basically, the attribute frameborder="0" is no longer is necessary in HTML 5 – here’s W3C Schools opinion. However, Google’s reCAPTCHA example code and recaptchalib.php files are not updated to correct this, as you can see here:

<iframe src="http://www.google.com/recaptcha/api/noscript?k=your_public_key"
height="300" width="500" frameborder="0"></iframe>

Therefore, simply remove the attribute frameborder="0" and you have successfully managed to make your HTML valid. You may want to style the iframe using CSS instead now.

[browser-shot width=”600″ url=”https://developers.google.com/recaptcha/docs/customization”]

What about WordPress and other content management sites?

Also, remember that any WordPress sites or any other content management scripts which have plugins provided may also keep this attribute frameborder="0" in the code. Try looking for the ‘recaptchalib.php’ file in these plugins and search for the  frameborder="0" and remove it.

Let us know below if this has helped you out. If you need any help or advice with your website, please contact us.

Leave a Reply