setting focus

L

lasher168

Hi,

I have the neccesity to place focus on a piece of text which is a cell
inside a table. The reason why I need this is because whenever the page
refreshes it always goes to the top of the screen and the user needs to
scroll down to the where this information is. After the screen
refreshes about 1 dozen times this can be quite annoying. I have tried
a number of different things all involving focus() however with no
luck. Any recomendations would be appreciated.

Regards,

Chris
 
R

Randy Webb

lasher168 said the following on 6/20/2006 5:44 AM:
Hi,

I have the neccesity to place focus on a piece of text which is a cell
inside a table. The reason why I need this is because whenever the page
refreshes it always goes to the top of the screen and the user needs to
scroll down to the where this information is.

Put an anchor there and refresh the page to the anchor.
After the screen refreshes about 1 dozen times this can be quite annoying.

It would only take 2 or 3 refreshes to annoy me, not counting having to
scroll down to where I was. It wouldn't take a dozen times.
I have tried a number of different things all involving focus() however
with no luck. Any recomendations would be appreciated.

That is because there is no .focus() for a non form input field such as
a cell inside a table.

If the anchor won't work, track the scroll position and save it in a
cookie. Onload of the page, check the cookie and scroll back to where
they were.
 
B

Bart Van der Donck

lasher168 said:
I have the neccesity to place focus on a piece of text which is a cell
inside a table. The reason why I need this is because whenever the page
refreshes it always goes to the top of the screen and the user needs to
scroll down to the where this information is. After the screen
refreshes about 1 dozen times this can be quite annoying. I have tried
a number of different things all involving focus() however with no
luck.

Here is a gimme-gimme-gimme solution:

<div style="height:800px;">&nbsp;</div>
<table border="1">
<tr>
<td><a name="value">here</a></td>
</tr>
</table>
<div style="height:800px;">&nbsp;</div>

Suppose the page's name is p1.html, then a refresh to p1.html#value
should do the trick.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top