I don't have a field name. I only have one field on my HTML pages, which is the 
search box. This is my Form:
  <form method="get" action="#" onsubmit="highlight(this.highl.value);return 
<input type="text" id="highl" />
<input type="submit" value="Search this Page" /><br />
How do I make the cursor default to the search box? Where would I put the 
document.getElementById('myfield').focus(); line in my HTML code? Can I add it 
to this code:
<body onLoad="beginSearch ()">

Paul Hanson
Technical Writer
RoboHelp ACE -
Quintrex Data Systems<>
email: phanson at

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Pennell

Do you mean you want to automatically give focus to a particular form field 
when the page loads? You can simply call the .focus() method on the element:


Consider the accessibility implications, first, though; not everyone will be 
happy to have decisions made for them about where they want their cursor to be. 

- Matthew.

List Guidelines:

Reply via email to