grecaptcha.reset(widget_id);
will reset the captcha
The widget_id value is optional, but recaptcha adds multiple into the source, so you need to grab the correct ID.
Add this to your child theme’s javascript file:
$( document.body ).on( 'checkout_error', function() {
var recaptcha_widget_id = $('.place-order #g-recaptcha-0').data("widget-id");
grecaptcha.reset(recaptcha_widget_id);
});
Hope this helps you out
-
This reply was modified 5 years, 1 month ago by spentpat.