WordPress’ comment form tabindex no-no

Edit the tabindex values in your Wordpress theme to improve accessibility

I came across some particularly annoying tabindex behaviour on a web form I was using (or trying to use) the other day, which got me thinking more about how tabindex should be used.

I recalled having read something by Roger Johansson on the topic (Overdoing Accessibility) and dug up the link to get some expert opinion. One instance of improper tabindex use he pointed out was the following:

A good example is the comment form in a default WordPress installation. The form controls (input fields and submit button) all have tabindexattributes despite already being in a logical order in the source. The effect is that keyboard users will skip straight to the comment form when they start tabbing through the page. Very annoying and completely useless, though probably well-meaning.

After checking a few themes (including the default Kubrick, and Pressrow), I found that all of them suffered from this problem. Sandbox, on which this site’s theme is based, is slightly different, with tabindex 1 and 2 being set on the search form, and the numbers between 2 and 6 not being assigned at all. Still definitely not ideal.

You can check out this behaviour for yourself: go to a WordPress blog using any of these themes and hit the ‘tab’ key on any page where a comment form is present, and you’ll be jumped down to the first field in the form.¬†

I plan to fix this on this site, and all the other WordPress themes I’ve developed as soon as I can.

1 thought on “WordPress’ comment form tabindex no-no”

  1. Yes, as long as our web structure is in a logical order, I don’t think we need tabindex.

    ATRC web checker needs it for level AAA test.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.