Answer the question
In order to leave comments, you need to log in
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>
$(".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("Ваше сообщение отправлено!");
}
});
});
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question