Insertion into textarea

Discussion in 'JavaScript' started by JordanStreet, Jun 11, 2007.

  1. #1
    I have a button next to a textarea when they click that button it launchs another window. Now I need another button that will take a value (it will be an html code) close that window, and put that value in the textarea.

    Sort of like how when you click the link button in this wysiwyg editor it pops up a window that asks for some stuff and then inserts it here.

    Any help is much appreciated,
    thanks,
    Jordan
     
    JordanStreet, Jun 11, 2007 IP
  2. ziffgone

    ziffgone Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can access your web page's textarea, (the one from where the pop-up was opened from), like so:

    
    window.opener.[FORMNAME].[TEXTAREANAME].value= ~variable~
    Code (markup):
    Replace "[FORMNAME]" with the actual form's name and likewise for the textarea. Replace "~variable~" with whatever variable you are passing to the textarea.

    Hope that helps. :)

    Perry.
     
    ziffgone, Jun 11, 2007 IP
  3. JordanStreet

    JordanStreet Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    awsome man thanks a bunch :)
     
    JordanStreet, Jun 11, 2007 IP