When the drupal module is activated, when you go to /user to log in, you have a link that appear to Drupal.org Enter your drupal username, or an ID from one of our affiliates: Drupal., so when you use "tab" to switch from one input to another, you go in order :
- username input
- Drupal link
- password input
So I think the logic is biased as you're supposed to reach first username, then password and end by the submit button.

This patch add tabindex to input fields to force this behaviour.

Comments

ax’s picture

Version: 4.6.0 »
Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

very useful! how often do i find myself irritated that i'm not in the password field after <input username> <tab>.

patch applies cleanly against current cvs and works as expected. a big +1.

ezheidtmann’s picture

You are a genius! This has always bugged me, and now you've come up with a good fix. Code looks good, but I haven't tested it.

Bèr Kessels’s picture

+1 Very usefull indeed.
We should have fixed this long ago. But I guess that others, just like me, everytime thought "ah darned, that tabindex, I should really go and fix this. Hmm but not now".

Well, tostini took this up. Hope it gets committed soon.

Tobias Maier’s picture

+1 very good.
makes user expierience better :D

ax’s picture

these very useful 4 lines should definitely go into 4.7.

dries’s picture

Status: Reviewed & tested by the community » Postponed

We've never worried about tabindices. Postponed for now.

ax’s picture

Status: Postponed » Reviewed & tested by the community

Dries, please reconsider this. Did you ever had to log into a site with DA-modules enabled? It looks like this:

now

Username:
Enter your <site_name> username, or an ID from one of our affiliates: <DA_module_1>, <DA_module_2>, <DA_module_3>, <DA_module_4>, <DA_module_5>.
Password:
Enter the password that accompanies your username.

Now aren't you at least a little confused that the cursor isn't in the password field after <input username> <tab>? Now look at it after applying this 4 lines patch:

after patch

Username:
Enter your <site_name> username, or an ID from one of our affiliates: <DA_module_1>, <DA_module_2>, <DA_module_3>, <DA_module_4>, <DA_module_5>.
Password:
Enter the password that accompanies your username.

Still think that should be postponed? Quite some people, including me, for sure don't.

ax’s picture

that last comment was supposed to be 2 forms, posted as "full html". apparently, project.module doesn't like this. so i put the before / after demo at my Drupal site.

Crell’s picture

True, there's no global Drupal tabindex policy. So? This is a useful improvement, breaks nothing, and improves usability. Big +1 here. Let's get it into 4.7.

If we've never worried about tabindex before, maybe it's time to start. :-)

tostinni’s picture

In fact I didn't remind other places where tabindex should be taken care of, but if you find some, please list them, I would made the patches.
For example, I was considering create content, and for the moment, all input are in correct order... till the day we decide to put some URL in help texts...

ax’s picture

asimmonds’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.72 KB

Have updated this patch to use the new Forms API

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

simple and useful .. lets try this again :)

asimmonds’s picture

Status: Reviewed & tested by the community » Needs work

I forgot I did this patch update, it was done before the form item types were prepended with '#'. So this patch requires updating to the current form api.

asimmonds’s picture

Status: Needs work » Needs review
StatusFileSize
new1.81 KB

Update for the current Form API

asimmonds’s picture

StatusFileSize
new1.75 KB

Sync'ed patch with HEAD

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
Bèr Kessels’s picture

I really like this path. another +1 (on top of my previous one) It works as expected.
(And I have to really get used to not hitting tab twice. It has become a habit ;) )

moshe weitzman’s picture

perhaps a cvs reviewer could reconsider this and post here is unacceptable. this is such a small change.

dries’s picture

I can't reproduce the problem on http://drupal.kollm.org/files/tabindex.html. It works fine with both Firefox 1.5 and Safari. Weird.

moshe weitzman’s picture

thats is weird because ax's page illustrates the problem for me in Firefox 1.5 and Opera 8, and IE6. All tested on Windows OS.

MarcoZ’s picture

Dries, I can confirm that the first form takes me to the username, then to the bunch of links, then to the Password field as well. Again, this is under Windows using FF 1.5 or IE 6, not MAC OS. I believe this is a very useful patch indeed.

Marco

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Looks like everyone can reproduce this but me. Weird.

Anonymous’s picture

Status: Fixed » Closed (fixed)