Move Cursor To Form Field

Rrrrg.  There is nothing more annoying than having to leave the keyboard and click into a form field before being able to enter any text into it.  Below is the javascript method to pre focus the cursor on a form field.  ( I don’t do it on the search field on this page because a) the search is rarely used upon arriving here and b) focusing at that field moves the top of this page out of view.

In <head> </head> section:
function focus(){document.FORM_NAME.FIELD_NAME.focus();}
// –>

In <body> tag:  <body onLoad=focus() >

1 comment to Move Cursor To Form Field

Leave a Reply