Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I position cursor on page

Status
Not open for further replies.

pjb

Programmer
Joined
May 1, 2001
Messages
148
Location
US
On the initial display of my HTML page, all the fields are blank. I would like to have the cursor positioned at the first text input field. I have used the onload event for the Body of document. In the event, I coded a focus() and select() for the field I want the cursor moved to. When the field is blank, the cursor does not appear. If I force a value into the field, it will display highlighted. How can I have the cursor positioned and blinking at the first input field when my form is initially displayed??
 
Try using this code in the BODY tag:

<BODY onload=&quot;document.FormName.ObjectName.focus();&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top