#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    44
    Rep Power
    14

    Question Passing values between windows with javascript


    I wonder if anyone can help

    I have one form with

    <form name="form1" action="form1.php" method="post">

    on it I open a pop up window using

    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,'resizeable=no,height=500,width=200');
    }

    which opens up another window

    <form name="form2" action="form2.php" method="post">

    I want to send some info from the pop up window into a text box on the form1.

    Any ideas how to do this or if is possible doing something like

    window.form1.textbox.value = "test"
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    To get aform entry on the parent window to be filled in you have to use the format:

    opener.document.formName.formItem.value = whatever

    I haven't really used this method before but that's what you do!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Chicago, IL
    Posts
    63
    Rep Power
    14
    follow this excellent tutorial: http://www.wsabstract.com/javatutors/send1.shtml
  6. #4
  7. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16

IMN logo majestic logo threadwatch logo seochat tools logo