Values from a pop-up window sent to main window

Discussion in 'JavaScript' started by grobar, Feb 11, 2007.

  1. #1
    I have a pop-up window where user uploads a file.

    what is the best way to insert that value in to a textarea in the main page? The textarea has ID="tal"
     
    grobar, Feb 11, 2007 IP
  2. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    You can't access the 'value' attribute of an <input type="file"> with JavaScript, because of security reason. But if you can get the value from somewhere else (maybe let the file be uploaded first, then you have your server-side script pass back the user's local file name to a JavaScript variable), then you can do:
    window.opener.document.getElementById("tal").value = theFileName;
     
    phper, Feb 11, 2007 IP