It is because it's a frame :)

You can grab a handle to the frame in javascript, and then manipulate
elements of the document that way so long as both pages come from the
same domain.  However, I think it would be better to create a function
on the page in the frame that focuses for you, and call it from the
top page via the frame handle.  Which you choose really depends on
your style and whether you need to worry about cross browser issues,
etc.

Be advised that getting an iframe via the DOM (getElementById) and the
browser's object (document.frames) gives you different objects.

Here's a quick example for you using the frames collection (not sure
if it'll work, haven't tested):
document.frames("myframe").document.forms("myform").elements("myinput").focus()

Tyler

On Oct 21, 4:00 pm, Tio <[EMAIL PROTECTED]> wrote:
> I'm using greybox to pop up forms, which in turn update the calling
> page... all good there, but I cannot get the javascript focus()
> function to put focus on the input field in the greybox.
>
> I'm assuming it is because it is a 'frame'... anybody shed any light
> on how to specify the field to get focus?
>
> TIA
--~--~---------~--~----~------------~-------~--~----~
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