I had exactly the same issue. Are we the only ones using Greybox for
more than fancy image popups? Whatever... The short answer is:

top.frames[0].frames[0].document.getElementById
('idofyourformelement').focus()

called from within the Greybox, although that should not matter.
Assuming you have only one main page and call Greybox from that.

With top.frames[0] (of type window) you have access to the Greybox-
Loader (loader_frame.html) that in turn loads the actual page within
an iframe. Hence the .frames[0] - thing. From that, you can apply the
usual stuff to get things working. Unfortunately the iframe for
loading the page does not have a name; otherwise one could use that.

The problem is, if you really want to focus right after loading, it is
next to impossible due to crazy race conditions. I tried to add the
code directly after Greybox gets created in loader_frame.html - it did
not work. Even with the onload event in the page that the Greybox
load, did not solve the problem. Therefore I can only recommend using
something like:

window.onload=function(){

          window.setTimeout("top.window.frames[0].frames
[0].document.getElementById('inputstart').focus();",1500);

        }

In the page that the Greybox loads...

Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GreyBox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/greybox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to