Answer the question
In order to leave comments, you need to log in
How to put your event on google captcha?
The essence of the question is that I need to hang up an event on google captcha and then process this event in js. Those. I have a site on wp, there is a contact form 7, I hang an event on the captcha according to the standard (I tried absolutely everything on any block) nothing happens, it does not react to it.
I tried to do this, for example
$(document).click(function(event) {
alert('was click to document');
})
$('.g-recaptcha').attr('data-callback', 'checkCallBack()');
function checkCallBack() {
alert('success function');
}
$(document).ready(function() {
} )
Answer the question
In order to leave comments, you need to log in
It 's all written in the docs
<script type="text/javascript">
var verifyCallback = function(response) {
alert(response);
};
var widgetId1;
var widgetId2;
var onloadCallback = function() {
// Renders the HTML element with id 'example1' as a reCAPTCHA widget.
// The id of the reCAPTCHA widget is assigned to 'widgetId1'.
widgetId1 = grecaptcha.render('example1', {
'sitekey' : 'your_site_key',
'theme' : 'light'
});
widgetId2 = grecaptcha.render(document.getElementById('example2'), {
'sitekey' : 'your_site_key'
});
grecaptcha.render('example3', {
'sitekey' : 'your_site_key',
'callback' : verifyCallback,
'theme' : 'dark'
});
};
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question