SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Passing information using Javascript

    Question, I have a pop up window that comes up and the user searches for a location in that window. When the results are found it shows the records. Now is there a way to click on the location and with javascript the window will close and it passes back the location to the previous window which is a fill out form and auto populates whatever field i want with the data the user clicked on?

    Does this make sense? So for example the user fills out the form. Needs to find location so they click on a link on the form that brings up a pop up window. In the window they search for that location and it displays. The user then clicks the location, the window closes and the form is now showing with whatever form field I specified populated with the location the user clicked on

    Thanks
    Silly

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Let's try something:

    Your first window contains a form. For argument's sake let's call it "form1". In form1, you have a textbox called "location". You can pass info from the popup window like so:
    Code:
    opener.document.forms['form1'].elements['location'].value = "blah";
    Replace "blah" with whatever value you need.

  3. #3
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, worked. Thank you!

    Silly


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
  •