I
I
IgorRastarov2017-06-20 12:42:04
reCAPTCHA
IgorRastarov, 2017-06-20 12:42:04

How to check google captcha with ajax?

Hello. Tell me please. There is a mold

<form action="/callback/" id="fastBuyFormBasket" method="GET">
  <div class="formLine"><input name="name" type="text" placeholder="Имя*" value="" id="fastBuyFormNameBasket"></div>
  <div class="formLine"><input name="phone" type="text" placeholder="Телефон*" value="" id="fastBuyFormTelephoneBasket"></div>
  <div id="recaptcha2"></div>
  <div class="formLine"><a href="#" id="fastBuyFormSubmitBasket">Заказать</a></div>	
</form>

Here in this piece of the code there is an error handling.
var sendFastBackBasket = function(event){		
  var $fastBuyForm = $("#fastBuyFormBasket");
  var $fastBuyFormName = $fastBuyForm.find("#fastBuyFormNameBasket").removeClass("error");
  var $fastBuyFormTelephone = $fastBuyForm.find("#fastBuyFormTelephoneBasket").removeClass("error");

  if($fastBuyFormName.val() == ""){
    $fastBuyFormName.addClass("error");
  }

  if($fastBuyFormTelephone.val() == ""){
    $fastBuyFormTelephone.addClass("error");
  }

I need to do captcha processing. I
did this for a test. Does not react.
if($("#recaptcha-anchor").attr("aria-checked", false){
  console.log("error");
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question