can a popup window return data to parent window?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default can a popup window return data to parent window?

    Is it possible to do the following in php:
    I want to have a main form open. In the form I want a button that will
    open a popup window so the user can search for something. The user can
    then select what they want, and the popup window closes and the main
    form (which is still open) shows the search results.

    Can anyone suggest a best course of action to acheive this?
    Thanks
    nadia Guest

  2. Similar Questions and Discussions

    1. Insert Data into DB using a PopUp window
      Hi everyone, Can someone tell me how to insert data into a databse using a Popup window. I am having problems getting it to work. Thank you.
    2. pdating parent window from popup....
      hi All: This is the situaton.. I have a treeview with nodes in an aspx page. The node data is coming from DB. when i select a node and click add...
    3. Updating parent window from popup
      Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
    4. Refresh a parent window???
      I have a frameset. left and main. Inside the main frame I have a IFRAME. I need to refresh the main frame when I post a form inside the IFRAME. I am...
    5. Refresh Parent window from child window causes problems
      Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence...
  3. #2

    Default Re: can a popup window return data to parent window?

    nadia wrote:
    > Is it possible to do the following in php:
    > I want to have a main form open. In the form I want a button that will
    > open a popup window so the user can search for something. The user can
    > then select what they want, and the popup window closes and the main
    > form (which is still open) shows the search results.
    >
    > Can anyone suggest a best course of action to acheive this?
    > Thanks
    You'll need a bit of javascript in there as well.

    The simplest way is probably to get the results page to take an optional
    search parameter. All the popup has to do then is do the following:

    <script language="javascript">
    function search() {
    var searchstring;
    // get search parameters into searchstring

    window.opener.location.href = 'resultspage.php?' + searchstring;
    window.close();
    }
    <form onSubmit='search()'>
    <!-- actual search form -->
    </form>

    Kevin Thorpe Guest

  4. #3

    Default Re: can a popup window return data to parent window?

    Sounds like a javascript thing.

    Just look for some examples for changing form values.
    The only difference is you need to reference the opening window..
    it'd be something like
    (from the pop-up)
    opener.document.forms[1].inputname.value = 'new value'; // my
    javascript is terrible

    ??

    [email]nsm38@student.cpit.ac.nz[/email] (nadia) wrote in message news:<9caa8908.0309241538.7359ae2b@posting.google. com>...
    > Is it possible to do the following in php:
    > I want to have a main form open. In the form I want a button that will
    > open a popup window so the user can search for something. The user can
    > then select what they want, and the popup window closes and the main
    > form (which is still open) shows the search results.
    >
    > Can anyone suggest a best course of action to acheive this?
    > Thanks
    BKDotCom Guest

  5. #4

    Default Re: can a popup window return data to parent window?

    suppose there is a text field with an ID as tx1 in the opener window.
    You can set its value from the popup window by

    opener.element.getElementByID("tx1").value = "search result";


    [email]nsm38@student.cpit.ac.nz[/email] (nadia) wrote in message news:<9caa8908.0309241538.7359ae2b@posting.google. com>...
    > Is it possible to do the following in php:
    > I want to have a main form open. In the form I want a button that will
    > open a popup window so the user can search for something. The user can
    > then select what they want, and the popup window closes and the main
    > form (which is still open) shows the search results.
    >
    > Can anyone suggest a best course of action to acheive this?
    > Thanks
    Thomas Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139