Click to See Complete Forum and Search --> : Files in an I-frame


BestZest
04-01-2003, 12:56 PM
If you have an I-frame with the src set to a folder on the users computer, is there a way to find out which file they have selected, and put the value in a text box or JavaScript varible?
eg.
<iframe id="nav" width=185 height=100 src="file://C:\Some folder"></iframe>

and get the file the user has selected in "Some folder"
Thanks,

BestZest

Jona
04-01-2003, 01:43 PM
I haven't tried this but let's see if it works....

<script>
function chng(){
var loc = document.getElementById("myIFrame");
loc.src = document.forms[0].File.value;
var theSRC = loc.src;
alert(theSRC);
}
</script>
</head><body>
<iframe src="file:///c:/windows.000/desktop/html/myFile.htm" id="myIFrame"> </iframe>
<form>
<input type=file name="File">
<input type=button value="Change IFrame SRC" onClick="chng()">
</form></body>

You can also check to see exactly which type of file they're using and make sure that it is a .htm, .html, .phtml, .sht, .shtml, or other HTML document.

BestZest
04-02-2003, 01:25 PM
Thnks Jona but it's not exactly what I was loking for. What I have is a frame ALREADY with a folder open. With Jona's script the user chose a file to open from ANY folder on their computer. I would like to find out which file is highlighted in the frame.

BestZest