Access iframe element from another iframe present in an div tag

Discussion in 'Javascript' started by karthickdevi@gmail.com, Nov 14, 2006.

  1. Guest

    Hi,

    I have an iframe , say 'iframe01' in my parent document. In the same
    parent document, i have a div tag and inside the div tag, i have
    another iframe, say 'iframe02'.
    Now i want to access the iframe01 element from the iframe02.
    Please suggest me how can i do it.

    I have tried the following, but i get as undefined.

    from iframe02,,
    window.frames[iframe01].document.getElementsByName('textfield')[0].value

    Thanks,
    Dev.
     
    , Nov 14, 2006
    #1
    1. Advertising

  2. ASM Guest

    a écrit :
    > I have tried the following, but i get as undefined.
    >
    > from iframe02,,
    > window.frames[iframe01].document.getElementsByName('textfield')[0].value


    parent.iframe01.document.getElementsByName('textfield')[0].value

    (if each of the 3 files are from same domain)

    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Nov 14, 2006
    #2
    1. Advertising

  3. Guest

    Hi,

    Thanks, this worked.

    Regards,
    Dev.

    ASM wrote:
    > a écrit :
    > > I have tried the following, but i get as undefined.
    > >
    > > from iframe02,,
    > > window.frames[iframe01].document.getElementsByName('textfield')[0].value

    >
    > parent.iframe01.document.getElementsByName('textfield')[0].value
    >
    > (if each of the 3 files are from same domain)
    >
    > --
    > Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    > Stephane Moriaux and his (less) old Mac already out of date
     
    , Nov 21, 2006
    #3
  4. Guest

    Hi,

    Thanks, this worked.

    Regards,
    Dev.

    ASM wrote:
    > a écrit :
    > > I have tried the following, but i get as undefined.
    > >
    > > from iframe02,,
    > > window.frames[iframe01].document.getElementsByName('textfield')[0].value

    >
    > parent.iframe01.document.getElementsByName('textfield')[0].value
    >
    > (if each of the 3 files are from same domain)
    >
    > --
    > Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    > Stephane Moriaux and his (less) old Mac already out of date
     
    , Nov 21, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    871
    John C. Bollinger
    Jan 27, 2006
  2. Ralf Wahner
    Replies:
    5
    Views:
    646
    Bob Foster
    Dec 24, 2003
  3. M Wells
    Replies:
    0
    Views:
    144
    M Wells
    Oct 6, 2004
  4. CRPietschmann
    Replies:
    1
    Views:
    246
    marss
    Apr 28, 2006
  5. visu
    Replies:
    4
    Views:
    315
Loading...

Share This Page