header
 
     
 
pixel
pixel pixel

Start cursor in a form field

It's debatable whether you want to do this or not but being a lazy person myself, it's always nice when going to a webpage with a form if the cursor is already waiting in the first text box. To achieve this, amend your HTML body tag as follows:
<body onLoad="document.forms[0].fieldname.focus();">
You'll need to amend it by changing 'fieldname' to the name of whatever text box you want the cursor to start in.

Unhelpful Helpful Rating 3.4 (score out of 5, no. of ratings: 34)
Comments
Comment by steph on 2005-08-04
exactly what I needed!

Comment by Pink on 2005-08-11
this is work! thank u.

Comment by Cheryl K on 2005-08-31
Wonderful! Just what we've been looking for!

Comment by Manish on 2006-01-03
Thanks! Looking for many more tips from you

Comment by ronniej on 2006-11-15
thanks heaps. very simple!

Comment by driver198 on 2007-04-16
Can't thank you enough! I found other very complicated solutions to this 'problem'. This made it a breeze.

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image