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"
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;