reCAPTCHA v2 won't allow submission in Internet Explorer when in a Bootstrap Modal

3,221 views
Skip to first unread message

Emilhem

unread,
Mar 10, 2015, 5:43:02 AM3/10/15
to reca...@googlegroups.com
I use reCAPTCHA v2 on a website using the grecaptcha.render function.

I have tested it in Firefox and Chrome without any issues.

Last week it worked in Internet Explorer 8 - 11 but this week it won't work in either. I've tested it on multiple computers and different networks.

It won't allow a correct entry of the captcha nor will it allow for it's submission when in a Bootstrap Modal.

YouTube video to display the issue: https://youtu.be/KnaQqqaz-00

JSFiddle to demonstrate the issue: https://jsfiddle.net/emilhem/Lgovn28f/2/

Does anyone else experience this issue?

Regards,
Emil

Emilhem

unread,
Mar 10, 2015, 11:19:51 AM3/10/15
to reca...@googlegroups.com
A slightly improved JSFiddle: http://fiddle.jshell.net/emilhem/Lgovn28f/6/

gcord...@gmail.com

unread,
Mar 16, 2015, 11:11:54 AM3/16/15
to reca...@googlegroups.com
I'm also experiencing this issue. It only occurs in Internet Explorer (Chrome and Firefox are fine). When the check box is clicked, the recaptcha words appear as expected, but clicking on the text box to enter the words seems to be where it's breaking. Maybe IE is blocking some resource from the iframe?

Emilhem

unread,
Mar 16, 2015, 4:10:13 PM3/16/15
to reca...@googlegroups.com
Check this solution that I found: http://stackoverflow.com/a/28965638/1294363

Regards,
Emil

Kadir Atasoglu

unread,
Mar 24, 2015, 5:19:14 AM3/24/15
to reca...@googlegroups.com
Same error here. My recaptcha is into the modal window. And text input not clickable. This error happen in IE10 and IE11. I am using jquery ui modal. If anybody have a solution please help us.

16 Mart 2015 Pazartesi 17:11:54 UTC+2 tarihinde gcord...@gmail.com yazdı:

Joe C

unread,
Dec 7, 2015, 3:46:05 PM12/7/15
to reCAPTCHA
reCAPTCHA 2.0 has this IE bug using Bootstrap modals.  

The hack mentioned worked for me (http://stackoverflow.com/a/28965638/1294363): 
$.fn.modal.Constructor.prototype.enforceFocus = function () { };

boxpart...@gmail.com

unread,
Mar 9, 2016, 10:38:42 AM3/9/16
to reCAPTCHA
I've found a solution for using Recaptcha V2 in a Jquery modal. This will allow interaction with the recaptcha iframe. Add the following js code:

$(document).ready(function () {
    try {
        $.widget("ui.dialog", $.ui.dialog, {
            _allowInteraction: function (event) {
                //This function fixes issue with IE11 not able to verify Recaptcha v2
                if (this._super(event)) {
                    return true;
                }
                // address interaction issues with general iframes with the dialog
                if (event.target.ownerDocument != this.document[0]) {
                    return true;
                }

                // address interaction issues with iframe based drop downs in IE
                if ($(event.target).closest("iframe").length) {
                    return true;
                }
            }
        });
        $("#modalDialog").dialog({
             //...
        });
Reply all
Reply to author
Forward
0 new messages