Results 1 to 5 of 5

Thread: [Resolved] JavaScript? : Pop up window variables

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135

    [Resolved] JavaScript? : Pop up window variables

    Hi,

    Basically I would like to know the simplest way of using pop up windows to gather information then feed it back to the parent page?

    I am using ASP mainly, but am guessing it's going to involve some JavaScript?!?

    Any help gratefully received,
    Cheers,
    Sparky.
    Last edited by Sparky; Nov 16th, 2004 at 07:44 AM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    One way is the InputBox, where the user can enter text values. Another would be to popup a small page in a window and then return the values to the parent page.

    Best way has always been to use a form and submit to the same/next page.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135

    Thanks

    Thanks mendhak,

    Do you have any examples of how to use a pop up page in a small window as this would be preferable. Basically I am getting a user to enter data but I dont have space for all the data so I would like to use a pop up form and then put it all into one string before returning it to a field on the parent page.

    Is this possible?

    Cheers,
    Sparky.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Copy paste:

    Code:
    <html>
    <head>
    <title>Simple Form</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function windowOpen() {
        var
    myWindow=window.open('popup.htm','windowRef','width=200,height=200');
        if (!myWindow.opener) myWindow.opener = self;
    }
    //--></script>
    <input name="openPopup" type="button" id="openPopup"
    onClick="Javascript:windowOpen();" value="Get Value" />
    <form name="form1" id="form1" method="post" action="">
        <input type="text" value="" name="output"></input>
    </form>
    </body>
    </html>
    
    THE POPUP FORM (popup.htm)
    <html>
    <head>
    <title>The Popup</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    
    <body>
    <script language="JavaScript"><!--
    function updateOpener() {
        window.opener.document.forms[0].output.value =
    document.forms[0].inputX.value;
        window.close();
    }
    //-->
    </script>
    EventId:
    <input type="text" name="inputX"></input>
    <input name="Close" type="submit" id="Close"
    onClick="Javascript:updateOpener()" value="Close"></input>
    </body>
    </html>

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135

    Cheers

    Thanks very much for that, just what i needed.

    Cheers,
    Sparky.

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