This is my code
$(document).ready(function(){
$(":submit").click(function(){
var onloadCallback = function() {
$( "#submitlogin" ).each(function() {
grecaptcha.render($( this ).attr('id'), {
'sitekey' : '6Lcjvi4UAAAAAIR7_ckItF2HfMEFHx427WUDdGDk',
'callback' : onsubmitlogin
});
});
$( "#submitsignup" ).each(function() {
grecaptcha.render($( this ).attr('id'), {
'sitekey' : '6Lcjvi4UAAAAAIR7_ckItF2HfMEFHx427WUDdGDk',
'callback' : onsubmitsignup
});
});
$( "#submitforgotpass" ).each(function() {
grecaptcha.render($( this ).attr('id'), {
'sitekey' : '6Lcjvi4UAAAAAIR7_ckItF2HfMEFHx427WUDdGDk',
'callback' : onsubmitforgotpass
});
});
};
});
});
I want to load onloadcallback
function, only when submit
button is clicked.
But seems like the code inside it, never gets called. What's the problem?
If the problem is not in this code, then let me know, I will update my answer with more code from my original website