showModalDialog and Focus on screen

  • Thread starter Thread starter Kumar Mettu
  • Start date Start date
K

Kumar Mettu

Hi All,

I am encountering a strange issue and hoping someone can help me
with this.
I show a HTML (Help) Page in my application using showModalDialog
with scrollbars enabled. This page has some text and single button to
close the modalDialog. When the text is long, focus automatically goes
to the Close the button when ModalDialog is shown and scrolls to end of
the page since focus is on Close button.
Is the a way I can force ModalDialog to show begining of the page?

Thanks,
Kumar.
 
Hi Kumar,

Just put the Close button (or a copy of it, if so give it a different ID and
set focus to it onload) at the top of the web document. You could also set
the window to close when the esc key is pressed on document.onkeyup

BTW. You will find that the window.close() method has changed in behaviour
for XP and IE6 SP2 and IE7 versions.

Regards.
 
Back
Top