Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    79
    Thanks
    1
    Thanked 0 Times in 0 Posts

    capture parameter from iframe to main.html

    I have the following HTML code in main.html:
    .............
    .............
    <tr align="right">
    <td width="50%">
    ...
    ...
    ...
    </td>
    <td width="50%">
    <iframe src="../createproject.html width="100%" height="400pt" frameborder="0" scrolling="no">
    </iframe>
    </td>
    </tr>
    ...........
    ...........
    and createproject.html:
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="../user.css" />
    <script type="text/javascript" src="../projects.js"></script>
    <head>
    <body onload="return capture_profile()">
    <div align="right" class="data-font">
    <form action="/cgi-bin/createproj.cgi" method="POST">
    <fieldset>
    .......
    .......
    .......
    </fieldset>
    </form><br/>
    </div>
    </body>
    </html>
    I'd like capture with capture_profile() function in createproject.html a value into main.html page.
    How can I solve this problem with javascript?

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    <body onload="parent.myVar = capture_profile()">

    If not already defined, myVar becomes a global variable in the parent document, containing the return value of capture_profile.
    Remember that the wanted value may not become available immediately.


  •  

    Posting Permissions

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