Answer the question
In order to leave comments, you need to log in
Why does google recaptcha kill POST by returning it empty?
Put 2 Invisible Recaptchas. 1 works flawlessly. 2nd works, but the post from the form comes empty. I can't figure out what's wrong
First form
<form id="contactForm1" action="/feed.php" method="post">
<input type="text" name="call_name" placeholder="Ваше имя">
<input type="text" name="call_num" placeholder="Номер телефона">
id="submit1"
type="submit"
value="Заказать"
>
</form>
<form action="/feed.php" id="contactForm2" method="post">
<input type="text" name="call_name" placeholder="ФИО">
<input type="text" name="call_num" placeholder="E-mail или телефон">
<textarea name="call_comment" rows="4" cols="40" placeholder="Ваше сообщение"></textarea>
<input id="submit2" type="submit" value="Заказать">
</form>
<script type="text/javascript">
var onSubmit1 = function(token) {
document.getElementById('contactForm1').submit();
};
var onSubmit2 = function(token) {
document.getElementById('contactForm2').submit();
};
var onloadCallback = function() {
grecaptcha.render('submit1', {
'sitekey' : 'ключ1',
'callback' : onSubmit1
});
grecaptcha.render('submit2', {
'sitekey' : 'ключ2',
'callback' : onSubmit2
});
};
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" type="text/javascript"></script>
array(3) { ["call_name"]=> string(0) "" ["call_num"]=> string(0) "" ["call_comment"]=> string(0) "" }
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