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 strongm 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 move the focus to a link? 1

Status
Not open for further replies.

hirick

Programmer
Aug 16, 2000
33
US
I want to put my "Previous Page" and "Next Page" links into a separate frame, so they'll always be in the same place and I don't need to copy them into every page.

When I tab to the frame, first the window gets focus, and then I need to tab to the Previous Page link.

I've tried to catch the onfocus in the frame window and set the focus to my first link, but it says the object doesn't exist. I've tried changing the tabIndex, and that doesn't do anything.

Is this possible?

Thanks for any help.
 
Have you tried:

if(document.all)onFocus = document.all['linkName'].focus();
// variations for other browsers.

Sometimes it seems to matter how you address stuff. So you give your link an id, and try the code above - put it in your body tag, and it should focus on the link when that frame recieves the focus.

If it says the object doesn't exist - then that implies there is an addressing issue, and you may need to look @ your syntax.

I think tabindex is for forms only.
b[sup]2[/sup] - benbiddington@surf4nix.com
 
This works! I wouldn't have thought of that combination.
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top