Answer the question
In order to leave comments, you need to log in
How to get g-recaptcha-response?
<form id="form-send">
<p>Key:<br> <input name="key" type="text"></p>
<div class="g-recaptcha" data-sitekey="my_key_recaptcha"></div>
<p><input name="button" type="submit" value="Отправить"></p>
</form>
<script>
$("#form-send").submit(function(e) {
e.preventDefault();
var captcha = $('g-recaptcha-response').val();
console.log(captcha);
var key = $("#key").val();
$.ajax({
type: "POST",
url: "sendKey.php",
data: {
"key": key
},
cache: false,
success: function(response) {
alert("ok");
}
}).done(function() {
//
});
});
</script>
<script src="https://www.google.com/recaptcha/api.js"></script>
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