Pass n Receive Data

[Total: 0    Average: 0/5]

This will show how to have 2 files submit data to the other.

Body Code:

<!--
1. Save this file with any name you like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Untitled</title>
</head>

<body>

<form name=f1 action=two.html target=_b>
<input type=text name=t1 value="something">
<input type=hidden name=h1 value="two">
<input type=submit>
</form>

</body>
</html>


-->


<!--
2. Save this file as two.html in the same directory as the above file.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Untitled</title>
</head>

<body>
<form name=f2>
<input type=text name=t2 value="default">
<input type=text name=h2 value="one">
</form>
<script>
var x=document.location.search;
if(x.indexOf("?")==0)x=x.substring(1,x.length);
document.write("Parameter list: "+x);
var y=x.split("&");
var t1=y[0].split("=")[1];
var h1=y[1].split("=")[1];
document.f2.t2.value=t1;
document.f2.h2.value=h1;
</script>

</body>
</html>

-->

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *