Web directory - Kamala - ID badge - Debt Consolidation - Find services

PDA

View Full Version : Values from a pop-up window sent to main window


grobar
Feb 11th 2007, 7:36 pm
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"

phper
Feb 11th 2007, 8:35 pm
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;