D
D
denism3002022-03-20 19:07:27
MODX
denism300, 2022-03-20 19:07:27

How to attach Invisible reCaptcha to AjaxForm + FormIt?

I'm trying to attach Invisible reCaptcha to forms, using the recaptchav2 add-on Form
call


form chunk
<form id="contact-page-form" action="" method="post" class="ajax_form">
    <div class="form-group">
        <input type="text" name="name" required="" class="form-control" placeholder="Ваше имя*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <input type="email" name="email" class="form-control" placeholder="Ваш email*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <input type="text" class="form-control" id="phone" name="phone" required="" placeholder="Ваш телефон*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <textarea rows="4" name="message" required="" class="form-control word-count" data-maxlength="200" data-info="textarea-words-info" placeholder="Сообщение*"></textarea>
        <span class="error error_name"></span>
    </div>
    <div class="form-group form-check">
        <input type="checkbox" class="form-check-input" id="privacyCheck" required="">
        <span class="error error_name"></span>
        <label class="form-check-label" for="privacyCheck">Согласен на обработку персональных данных</label>
    </div>
    <p class="text-small">Ставя отметку, я даю свое согласие на обработку моих персональных данных в соответствии с законом №152-ФЗ «О персональных данных» от 27.07.2006 и принимаю условия <a href="" rel="nofollow" target="_blank">Пользовательского соглашения</a></p>
    <div class="text-center">
        
        
    </div>
    
    
</form>

recaptchav2_invisible_html chunk
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
    function recaptchaV2SubmitForm(response) {
        return new Promise(function() {
            document.getElementById('').submit();
        })
    }
</script>
<button type="submit" class="btn btn-landcad big-btn g-recaptcha" data-sitekey="" data-callback="recaptchaV2SubmitForm">Отправить</button>

I get an error after clicking submit
Please select the checkbox in the ReCaptcha image.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question