Add an empty <div>
to your form where you would like the reCAPTCHA widget to appear. The <div>
will be populated with the widget upon page load.
The widget will populate with the familiar "I am not a robot" mechanism.
- The div must have
data-recaptcha
attribute.
- The div must have
data-sitekey
with your reCAPTCHA site key as its value.
- Only one
[data-recaptcha]
may be initialized per form.
Obtain your site key
from the Google reCAPTCHA admin panel where your keys are managed.
<form action="/forms/mailchimp.php" data-form-email novalidate>
<div class="form-row">
<div class="col-12">
<input type="email" class="form-control mb-2" placeholder="Email Address" name="email" required>
</div>
<div class="col-12">
<div data-recaptcha data-sitekey="ENTER-YOUR-RECAPTCHA-SITE-KEY-HERE"></div>
</div>
<div class="col-12">
<div class="d-none alert alert-success" role="alert" data-success-message>
Thanks, a member of our team will be in touch shortly.
</div>
<div class="d-none alert alert-danger" role="alert" data-error-message>
Please fill all fields correctly.
</div>
<button type="submit" class="btn btn-primary btn-loading btn-block" data-loading-text="Sending">
<!-- Icon for loading animation -->
<svg class="icon" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Icon For Loading</title><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g><polygon points="0 0 24 0 24 24 0 24" opacity="0"></polygon></g><path d="M12,4 L12,6 C8.6862915,6 6,8.6862915 6,12 C6,15.3137085 8.6862915,18 12,18 C15.3137085,18 18,15.3137085 18,12 C18,10.9603196 17.7360885,9.96126435 17.2402578,9.07513926 L18.9856052,8.09853149 C19.6473536,9.28117708 20,10.6161442 20,12 C20,16.418278 16.418278,20 12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 Z" fill="#000000" fill-rule="nonzero" transform="translate(12.000000, 12.000000) scale(-1, 1) translate(-12.000000, -12.000000) "></path></g></svg>
<span>Subscribe</span>
</button>
</div>
</div>
</form>