1
I need to validate Recaptcha in a form. But, it’s not working.
function validaCaptchaContato() {
if(document.querySelector('#g-recaptcha-contato').value == '') {
alert('Marque a opção "Não sou um robô"');
return false;
}
}
<form method="post" id="form-contato" onsubmit="return validaCaptchaContato();">
BLABLABLABLA
<label>
<textarea class="fields textarea" name="mensagem" placeholder="Escreva sua mensagem." required></textarea>
</label>
<div class="captchaFix">
<div class="g-recaptcha" data-sitekey="COPIEI CERTO"></div>
</div>
<input class="btn-submit" type="submit" name="enviar" id="g-recaptcha-contato" value="Enviar">
</form>
What might be going on?
what error is happening? what exactly isn’t working?
– Ricardo Pontual