document.form.input.focus() without browser jump?

U

usenet

Hi all,

I have a page that contains a search form with a single text input
field. The form is located on the lower portion of the page, well
beyond the fold/jump/etc. and its position is out of my control. When
the page loads, I would like to have the input focus set to that text
field, so that savvy users can immediately type their query and hit
Enter to post the search, without having to scroll down and click into
the field first.

So far, my attempts at implementing this have resulted in the browser
automatically jumping to the location of the text field when the page
loads. I'm calling document.myForm.myField.focus() in the <body
onLoad=""> attribute. Is there another way to set the focus to a form
field without having the browser automatically jump to that input?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top