Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.01 KB

05_1_recaptchaV3.md

File metadata and controls

33 lines (28 loc) · 1.01 KB

reCAPTCHA V3 Component

This component will enable reCAPTCHA v3 functionality on your form. Workflow:

  • Loads https://www.google.com/recaptcha/api.js if not available
  • Adds token to captcha field on your form

Back-End Configuration

First, you need to set up some server side configuration via form builder. Read more about it here.

Enable Component

import {RecaptchaV3} from 'js-pimcore-formbuilder';
document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.formbuilder.ajax-form').forEach((form) => {
        new RecaptchaV3(form);
    });
});

Extended Usage

document.addEventListener('DOMContentLoaded', () => {
    document.querySelectorAll('.formbuilder.ajax-form').forEach((form) => {
        new RecaptchaV3(form, {
            disableFormWhileLoading: true,
            reCaptchaFieldClass: 'input.re-captcha-v3',
        });
    });
});