Add recaptcha in form.

It is very simple to add captcha to html form.

Include the following div in the form where we have to include capcha

<div id="recaptcha-div" class="g-recaptcha" data-sitekey="DATA SITE Key" ></div>

Data site key is recaptcha key which we obtain after registering domain and site in reCAPTCHA admin console with Google account.A reCAPTCHA key is a unique alphanumeric string of 40 characters.

And include following js in our page

<script src="https://www.google.com/recaptcha/api.js"></script>

We can set two attributes to grecaptcha depending on the design

data-size =”compact” or data-size=”normal”

When data-size =”compact” is applied,captcha section will be square type and section will be rectangle type if data-size is set to normal

Leave a comment

Your email address will not be published. Required fields are marked *