SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to make a child window interact with a parent one?

    Hi!

    I have the following issue - if a user select 'select box' as a value in a drop-down list, a new window is opened where they can enter values then they should click on a button and a text thay have typed should pass to a hidden field in the parent window.

    How do I do this?

    I tried this (child window)
    Code:
    <html>
    <head>
    <title>Values</title>
    </head>
    <body BgColor = "#FFFFFF">
    <form name = "f1">
    <textarea name = "ta"></textarea><br />
    <input type = "button" value = "Ok" onClick = "getValues ();" />
    </form>
    <script language = "JavaScript">
    function getValues ()
    {
    window.alert ( document.f1.ta.value );
    parent.aff.vals.value = document.f1.ta.value;
    }
    </script>
    </body>
    </html>
    But unfortuanelly it's not working!

  2. #2
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yo! I figured it out! I should have put 'window.opener.document' instead of 'parent'


Bookmarks

Posting Permissions

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