i have 2 forms on single page both use google recaptcha.
whenever use grecaptcha.reset(); resets first instance.
the following js renders recaptcha(s)
var recaptcha1; var recaptcha2; var mycallback = function() { //render recaptcha1 on element id "recaptcha1" recaptcha1 = grecaptcha.render('recaptcha1', { 'sitekey' : '1234', //replace site key 'theme' : 'light' }); //render recaptcha2 on element id "recaptcha2" recaptcha2 = grecaptcha.render('recaptcha2', { 'sitekey' : '1234', //replace site key 'theme' : 'light' }); }; how can reset instances or target specific instance.
the answer mbejda correct not quite.
through trial , error, found have this:
grecaptcha.reset(recaptcha1); grecaptcha.reset(recaptcha2); to clear, have save return values of grecaptcha.render(), , pass in vars reset() function. passing in string id of captcha doesn't work.
Comments
Post a Comment