faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 12 people (67%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How to Pass Data Between Pages

Oct 15th, 2006 22:11
Sidheshwar Nevade,


Main.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>
	Select File to Upload
</TITLE>
<script language="javascript">
	function getValue()
	{
		var var1 =  showModalDialog
('GetFile.htm','Test','dialogWidth:500px;dialogHeight:150px;center:1;res
izable=no;center=yes;edge=raised;status=no')
		document.getElementById("txtFilePath").value =  var1;
	}
</script>
</HEAD>
<BODY>
<form name = "aform">
<INPUT name="txtFilePath" id= "txtFilePath" value="Enter Path" width  
= "100" maxsize = "25"  style="WIDTH: 455px; HEIGHT: 22px" size=57>
<INPUT id="Select" type="button" value="Go" name="Select" 
onclick="getValue()">
</form>
</BODY>
</HTML>





GetFile.htm

<HTML>
<HEAD>
<TITLE>
	JavaScript
</TITLE>
<script language="javascript">

	function doCloseWindow(){
		window.returnValue = document.getElementById
("txtFileName").value
		window.close()
	}
	function doTask1(){
		document.getElementById("txtFileName").value = 
document.getElementById("file1").value
	}
</script>
</HEAD>
<BODY>
<br>
<form name="frmGetFile" action="GetFile.htm"  id="frmGetFile" >
<font face="verdana">Select Source</font>
<INPUT id=file1 style="WIDTH: 439px; HEIGHT: 22px" 
onpropertychange=doTask1() type=file size=52 name=file1>
<br>
<INPUT type="hidden"  id="txtFileName" name="txtFileName" style="WIDTH: 
446px; HEIGHT: 22px" size=56>
<br>
<center>
<INPUT type="button" id="Select" value="Close Window" name="Select" 
onclick="doCloseWindow()">
</center>
</form>
</BODY>
</HTML>