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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP SETTING FOCUS

Status
Not open for further replies.

donniea21

MIS
Feb 16, 2001
75
US
On my form when the user goes to add or edit an item, the focus is set to the first input box.This is fine but the problem is that it moves the screen so that the first input box is at the very bottom of the screen. Is there a way to set the focus to the input box and also position the screen to the center? Thanks
 
Sure, you can use the window.scrollBy(n,n) method. My JavaScript reference says that it will only work in Netscape, but my reference was written before IE 5, so all you can do is try.

Also, you might consider incorporating a bookmark in the HTML, the navigating to that bookmark which will move / scroll the document to that mark.

Hope this helps..

ToddWW :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top