form onload input focus

Don't use form onload input focus

Power users are people that use a system that have advanced skills and are much quicker at completing tasks. There are still many people that struggle to use forms on the web so we must make our forms as easy as possible to complete. Conversely there are people that have no trouble at all filling out forms on the web and we must not obstruct them and allow them to complete their task as quickly as possible.

Text that is blurred except for the middle word which is focusI fall into the second category. Login forms especially are very quickly filled out. As soon as the HTML has loaded I move my mouse cursor over the first form input and click inside. Once inside I immediately type my username, followed by the tab key and my password. Once that is complete I hit return. This is done lightning quick and enables me to be more productive.

The problem with forms that have an event in which the cursor is focused within the first element is they stop me completing the form quickly. What happens is that if I am typing within a form element and that element receives focus, the characters within the form element are highlighted. Therefore if a person is typing within a form element and it receives focus, the next letter they type will wipe what they have previously typed. This is because anything that is highlighted is deleted with a key press of the keyboard. It doesn't matter what key is pressed, if your characters are highlighted, they are deleted and replaced with the next character.

My recommendation is not to use an event that places the cursor within the first form element. It obstructs power users and can actually increase the time to complete the form dramatically. Alternatively you could check if any characters have been typed in any of the form elements and only give focus if the user is not typing anything.