SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Location
    Italy
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Return value from a pop-up window

    Hello,

    I have a problem with the popup window.
    I explain the idea:

    from the parent window i need some values that are in the db2 database,
    and when the user for example don't know the customer code, put in the field the name instead for example "fred",
    then i open the popup, where i receive the word "fred" and i show to the user the customers name that contents that name.

    When the user has choosen from the popup the right customer name is need return
    to the parent window the customer code without loose the contents of the others fields that the user
    have before insert.

    Well,
    the popup work well, but i don't know send back the code of the customer name
    that user has choosen.

    When i open the popup i use this javascript code between the FORM and /FORM tag

    <a href="popup1.php" onclick="MM_openBrWindow('popup1.php?&sigla=FER?tipocf=1&customer=?fred', 'newwindow','width=800,height=400'); return false;"
    onkeypress="MM_openBrWindow('popup1.php?&sigla=FER?tipocf=1&customer=?fred', 'newwindow','width=800,height=400'); return false;"
    value="Select Field1 From LIst" title="Esample of pop-up - Link inside - New window" target="_blank">pop-up1</a>

    and in the HEAD and /HEAD tag i add the fuction:

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL,winName,features);
    }
    //-->
    </script>

    Any suggestion will be appreciate.

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is a link to a document that will answer your question.

    http://www.plus2net.com/javascript_t...dow-child3.php
    intragenesis, llc professional web & graphic design

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Location
    Italy
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    more flexibility

    Thank you Holmescreek for your reply,

    the example work very well,

    but there is the possibility to write the javascript code more flexible in the name of form, parent and child field name ?

    If there were this possibility I could share with others father form the same popup child.


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
  •