Help! Text Field that is Filled Through a JavaScript PopUp

Discussion in 'JavaScript' started by tankard, Sep 17, 2009.

  1. #1
    Hi guys,

    Hope you can help me.
    Here is the story.

    • There is page1.html that has a text field and a button
    • If we click a button, a popup1.html appears with a drop-down box.
    • We select a value from a drop-down and click submit
    • The pop-up closes and the selection is now automatically entered into page1.html text field

    All this works as described, the problem is that I need three drop-downs on that pop-up and then they all three should be joined by a hyphen and filled into page1.html

    I tried to grab all three values into an array and use join(" - ")... doesn't work :(

    Any ideas and help much appreciated!
     
    tankard, Sep 17, 2009 IP
  2. Jj delc

    Jj delc Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The window object on the popup window will have a "opener" attribute, which will point to your page1.html window object. From then on you can navigate via DOM to your textarea and fillit out with the value you want.

    Set an onchange handler to all your boxes and add the string combo1.value + "-" + combo2.value + "-" combo3.value, if there are only three just join them manually
     
    Jj delc, Oct 6, 2009 IP