Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA iframe Content?

Status
Not open for further replies.

Woolers

Technical User
Jan 11, 2005
56
0
0
GB
Hi There,

Apologies if this has cropped up elsewhere, I did a search but couldn't find anything..

I found some code that launches an explorer type window inside an HTA & amended it, but it uses an iframe to load the content. - What I'd like to do is to return the value (name, path) of a folder clicked in the left window & put that value in the right window.. Is this possible at all?

The code (including error & probably obsolete code) is pasted below which you can copy & paste to see what I mean.

If this can't be done then fair enough, I just don't know the properties I can expose from the iframe content.

Any help or guidance appreciated.

Code:
<html>
	<head>
		<title>Simple Browser</title>
		<HTA:APPLICATION
			APPLICATIONNAME="Simple Browser"
			Windowstate="normal"
			sysmenu="yes"

		>
	</head>
<script language="VBScript">
		
Sub Window_Onload
	window.resizeTo 1024, 768
	window.moveTo 200, 80
	Set objNetwork = CreateObject("Wscript.Network")
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set colDrives = objFSO.Drives
		For Each objDrive in colDrives
			Set objFolOption = Document.CreateElement("OPTION")
			objFolOption.Text = objDrive.DriveLetter
			objFolOption.Value = objDrive.Path
			FolLocation.Add(objFolOption)
		Next
End Sub

Function NavLocal()
	document.getElementById("LocalData").src = LocalDrive.Value & "\"
	'NavRemote()
End Function

Function NavRemote()
	document.getElementById("RemoteData").src = 'Maybe something here???
End Function

Function EchoFol
val3 = document.getElementById("LocalData").contentWindow.testTxt.value
MsgBox val3
End Function
			
Sub ReLoad
	location.reload True
End Sub
			
Sub RunExit
	Self.Close
End Sub

</script>
<body>
	<table border="1" style="width:100%;height:95%;">
		<tr>
			<td>
				<b>Local Drive:</b><select NAME=FolLocation id=LocalDrive style="width:50px" onChange="NavLocal()"><b>:\</b>
				<input type=button value="Browse" id=local_button style="background-color:green; color:#fff; font-weight:bold;" onclick="NavLocal()"><br>
				<iframe id=LocalData style="width:100%;height:95%" application="yes"></iframe><br>
			</td>
			<td>
				<!--<b>Remote Path: \\</b><input type=text value="" id=RemotePath style="width:40%"><b>\</b>-->
				<!--<input type=text value="C" id=RemoteDrive style="width:20"><b>$</b>-->
				<!--<input type=button value="Remote" id=remote_button style="background-color:green; color:#fff; font-weight:bold;" onclick="NavRemote()"><br>-->
				<iframe src="" id=RemoteData style="width:100%;height:95%" application="yes"></iframe><br>
			</td>
		</tr>
	</table>
	<table>
		<tr>
			<td>
				<input type=button value="Refresh" id=reload_button style="background-color:blue; color:#fff; font-weight:bold;" onclick="ReLoad()">
				&nbsp&nbsp
				<input type=button value="Cancel / Quit" id=Exit_button style="background-color:blue; color:#fff; font-weight:bold;" onclick="RunExit()">
			</td>
		</tr>
	</table>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top