J
J
jorshjorsh952017-06-01 14:23:44
JavaScript
jorshjorsh95, 2017-06-01 14:23:44

ReCaptcha validation before form submission?

Hello everyone, I installed the recaptcha, on the server, etc., everything is fine, but how can I check if the checkbox is checked before sending it or not?

if (grecaptcha.getResponse() == ""){
  $('#grecaptcha').html('Подтвердите что вы не робот');
  return false;
}

Doesn't work, swears at . (in line 1, where is grecaptcha . ) Can

you please tell me how to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shalimov, 2017-06-23
@PiRmanAtE

I used this to test myself

var v = grecaptcha.getResponse();
            if (v.length == 0) {
                //
            }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question