How i can focus to current table in jsp

Hello experts,
In my jsp page, initially all tables are hidden. When clicked, those tables will get show.
The issue is, when a particular table is shown, the scroll bar is not focusing to the corresponding table. Instead it is focusing to the top of the page.

I used document.getElementById(tabId).focus();  in showHide() function of my code. But still it is not focusing to the table .

Please any ideas?

Myjsp.txt
AlpitaAsked:
Who is Participating?
 
AlpitaAuthor Commented:
I already attched my code in my previous comment.
I found the solution for my issue.
Need to add the statement "return false;" in <a> </a>.
Like this:
<a href="#" onClick="showHide('div2',2);return false;">div2</a>

Thanks,
Alpita
0
 
davasCommented:
sory i dont know
0
 
AlpitaAuthor Commented:
I simplified the question. I have attached a simple html page which has 8 div tags.
Lets say I clicked on div 8. it collapses. But it shows me the top of the page. Again I have to scroll down to see the collapsed div 8. If I click it (div 8) again, it will be expanded and automatically scroll to top of the page. I have to again scroll all the way down to see div 8.

I tried several ways such as scrollToView(true), divX.scrollTop=0.

My plat form is IE7 on Windows XP.

Could you provide any solution for this issue. Myjsp.html
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
AlpitaAuthor Commented:
Could some one look into this problem. I made it easy to understand. You can download the attached html and see the issue on you system itself.

Waiting for your quick reply.
0
 
chaitu chaituCommented:
you want focus in the table or in the cell of the table.any how send the HTML code.
0
 
AlpitaAuthor Commented:
Found the solutin.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.