Re: In-page popup not supporting DOM structure/properties

Pragash Mr.
Wed, 18 Jun 2008 09:15:06 -0000

Adhiraj Rankhambe wrote:
> In my current app, I have an in-page popup(those semi-transparent ones
> like you find on Facebook) for login, which has only two fields: login
> and password.
> I am not able to set focus in the login field.
>
> document.getElementById(''element'').focus();
doesn''t seem to work.
> document.getElementById(''element'') returns
"null".
>
> I have a link for ''Login'' on the ''Home
Page''. When user clicks on the
> Login link, an in-page pop is rendered on the same page, so you can see
> the ''Home Page'' in the background, but focus is on the
''Login popup''.
> I think that''s because we have two layers of documents, one the
''Home
> Page'' and second the ''Login'' popup''. So
something wrong with the DOM
> structure. Not sure...
>
> Does anyone know how to handle this situation?
>
> Thanks in advance
>
> Adhiraj




Hi,
   in javascript function use like
           "document.forms[0].elements[0].focus()"