data-tabindex doesn't work for me

936 views
Skip to first unread message

Jeff Dairiki

unread,
Jul 3, 2015, 9:44:25 PM7/3/15
to reca...@googlegroups.com
Has anyone managed to get the data-tabindex attribute on the div.g-recaptcha to work. My captcha HTML looks like

<script async defer src="https://www.google.com/recaptcha/api.js?hl=en"></script>
<div class="g-recaptcha" data-sitekey="[my sitekey]" data-tabindex="102"></div>

However, the resulting recaptcha iframe (and all other elements with tabindexes still have tabindex="0". Has anyone gotten this to work?
(If I go in and change the iframe’s tabindex (with the chrome developer console), tabbing works okay.)


tech....@gmail.com

unread,
Sep 2, 2015, 5:58:56 AM9/2/15
to reCAPTCHA
I'm trying to implement data-tabindex but I'm having the same problem as you.

Did you solve it?

Jeff Dairiki

unread,
Sep 2, 2015, 11:12:37 AM9/2/15
to reca...@googlegroups.com, tech....@gmail.com
On Wed, Sep 2, 2015 at 2:58 AM, <tech....@gmail.com> wrote:
I'm trying to implement data-tabindex but I'm having the same problem as you.

Did you solve it?

Unfortunately, no.

I haven't looked at this recently, in any great detail, but I have verified that the code quoted in my original message (with the data-tabindex attribute on the div.g-recaptcha) still appears not to work.

Han Sooloo

unread,
Jan 10, 2017, 12:20:14 PM1/10/17
to reCAPTCHA
Having the same problem ... wondering if there are any updates from Google?

sunshine...@gmail.com

unread,
Jan 11, 2017, 5:18:50 PM1/11/17
to reCAPTCHA

Han Sooloo

unread,
Jan 11, 2017, 5:33:23 PM1/11/17
to reCAPTCHA
So, this is what made it work for me:
Assuming all the form input fields are grouped under the same class="form-control" tag, the browser will provide the most logical tab order for you.

There is actually no use case (at least for me) to explicitly set the tabindex.  If I lay out the input elements, and group them, the browser will take care of the rest.

Although this _technically_ does NOT address the issue that the widget simply does not use the passed parameters as documented.


On Friday, July 3, 2015 at 9:44:25 PM UTC-4, Jeff Dairiki wrote:

Mickaël THOMAS

unread,
Jun 5, 2017, 5:33:12 PM6/5/17
to reCAPTCHA
It seems to be a bug. The iframe has the (wrong) lowercase "tabindex" property set correctly, but not the real "tabIndex" property.
Reply all
Reply to author
Forward
0 new messages