SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    When users goes to my page (main window) and click on a link, it pops up a new window, and that window contains more links.
    When users click on the links on the popped up page, i want some text to be added into a textbox on the main window.

    so like if the textbox has "Text1"
    and when user clicks on that link, the textbox will now have: "Text1 link.."

    I hope somebody can help me.

    Thanks!

    Sang N.


  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well, you can get at the window that opened the current window using 'opener'. Thus, your link should call a function that looks roughly like this:

    Code:
    function displayText(text) {
      var field = opener.document.forms['formName'].elements['textBoxName'];
      field.value = field.value + ' link...';
    }
    Hope this helps!
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •