Answer the question
In order to leave comments, you need to log in
How to validate and submit forms with Ajax if several forms have recaptcha?
Hello. I have 3 contact forms on one page, each has a recaptcha and I can't submit the form. I'm filling in the captcha, but I get an error You didn't enter the captcha. How to validate and submit forms with Ajax if several forms have recaptcha?
$("#form").on("submit", function() {
var form_data = $(this).serialize();
var captcha = grecaptcha.getResponse();
if (!captcha.length) {
alert("Капча пустая");
} else {
alert("Сообщение отправлено");
$.ajax({
type: "POST",
url: "captcha.php",
data: form_data,
});
};
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question