Results 1 to 8 of 8

Thread: How to read value from IFRAME to HTML page.

  1. #1
    Guest

    Question

    I have IFRAME element placed on HTML page. This IFRAME uses navigate method to ASP page and displays this ASP
    page which aventually would be hidden.
    I need to read some elements value from this ASP page to
    this parent(?) HTML page elements.Say,

    HTMLpage.formName.elementName.elementValue=
    ASPpage.formName.elementName.elementValue

    What would be right way to do that?
    I tried to use
    document.all.frames["MyIFrame"].document.all
    to read values, but it did not work.

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    parent.frames.document.yourFormName.yourElement.value=...

  3. #3
    Guest
    But how do I see an element which is inside IFRAME?
    IFRAME consists of ASP page with a form.

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    ok but after an asp page is request,it generate html or javascript,
    so you do the same!
    parent.frames.document.yourFormName.yourElement.value=...

    and what do u mean by IFRAME, what the I stand for??

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    document.all.iframename will get you access to the contents of the iframe

    You might get "permission denied" when trying to access an iframe's contents. I think it has something to do with cross frame scripting or something....

  6. #6
    Guest
    I've tried document.all.IFRAMEname as well as
    document.all.htmlIFRAMEname.document.all.ASPelementName.valu

    It should have given me value of the element inside of ASP page, but instead it gives me a values on a parent
    HTML page providing if I have a named objects on this page.Looks like it always redirects me back to parent HTML page and did not read anything inside of IFRAME despite that ASP page loads with no problems.


  7. #7
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Tough break, I've had trouble in the past trying to access the document in an IFRAME.....I don't think I ever got around it either....

  8. #8
    Guest
    Clunietp,
    Here is the way I found if ever need it.
    Instead of accessing values from parent to IFRAME,
    which seems to be impossible despite MSDN insisting on it,
    I assign values from child form to parent:

    <body onload="
    parent.document.form.element.value=form.element.value;">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width