V
V
Vladimir2017-09-11 09:28:10
reCAPTCHA
Vladimir, 2017-09-11 09:28:10

How to validate Recaptcha with Ajax?

Hello. Everything is simple. small shape

<form class="form-call" method="post" action="">
      <div class="title">ЗВОНОК</div>
            <div class="form-group">
                <input type="text" class="form-control callTwo js-mask-phone" name="phone" id="emailTwo" placeholder="Номер телефона">
            </div>
            <div class="form-group">
                <input type="text" class="form-control callTwo" id="pwdTwo" name="name" placeholder="Ваше имя">
            </div>
    <div id="recaptcha1"></div>	
        <button type="submit" class="btn btn-danger callMe">Отправить</button>
        </form>

AJAX processing:
$(".form-call").on("submit", function() { //устанавливаем событие отправки для формы с id=form
            var form_data = $(this).serialize(); //собераем все данные из формы
            $.ajax({
            type: "POST", //Метод отправки
            url: "send.php", //путь до php фаила отправителя
            data: form_data,
            success: function() {
                   //код в этом блоке выполняется при успешной отправке сообщения
                   alert("Ваше сообщение отправлено!");
        }
            });
    });

How to do recaptcha processing. I do not understand what and where to write

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sklyarov, 2017-09-11
@0example

First you need to determine if the person clicked on the Stackoverflow captcha at all , and then move on from the result. Everything is in the link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question