OK, Let's just take the simplest example. You only need 2 elements:
1. Overall frameset that holds the individual elements.
2. One visible frame within that frameset that holds the form and elements where the user interacts.
But, I use 3 files to show the variable persistence:
1. index.html
Code:
<html>
<head>
<title>Variable Persistence Explained</title>
<script language="Javascript">
mainvar = "Hello, World!";
</script>
</head>
<frameset cols="*" rows="100%">
<frame src="main.html" name="main" frameborder="0" />
</frameset>
</html>
2. main.html
Code:
<html>
<head>
<title>First page</title>
</head>
<body>
Parent frame says:
<script language="Javascript">
//document.write("Hello World");
document.write(parent.mainvar);
</script>
<form name="theform">
Your Answer: <input type="text" name="answer">
<input type="button" name=submit value="Send" onclick="parent.mainvar += '<br>' + document.title + ' says: ' + document.theform.answer.value">
<br><br>
<input type="button" name=next value="Go to next page: " onclick="window.location = 'main2.html'">
</form>
</body>
</html>
3. main2.html
Code:
<html>
<head>
<title>Second page</title>
</head>
<body>
Parent frame says:
<script language="Javascript">
//document.write("Hello World");
document.write(parent.mainvar);
</script>
<form name="theform">
Your Answer: <input type="text" name="answer">
<input type="button" name=submit value="Send" onclick="parent.mainvar += '<br>' + document.title + ' says: ' + document.theform.answer.value">
<br><br>
<input type="button" name=next value="Go to next page: " onclick="window.location = 'main.html'">
</form>
</body>
</html>
So, just place these three pages in the same folder, and load index.html in your browser. Enter an answer phrase to the "Hello World!" from the parent frameset. Then click the bottom button which loads the second page inside the frameset (main2.html). You will see that the parent frameset stores the variable update from the first, and outputs it to the page. You then add to it from this page, and it will be stored again, when you proceed to the first page again, etc...
You see the possibilities, I hope ;-). Now, this method doesn't realy use a "hidden" frame. It just stores the variable in the parent frameset. You can instead choose to have another frame:
Code:
<frameset cols="*" rows="100%","1">
<frame src="main.html" name="main" frameborder="0" />
<frame src="hidden.html" name="hidden" />
</frameset>
With this method, you can store variables in that frame, even submit them back to the server, and receive response data from the server, without refreshing the main page. This will take a little more work than I have time for right now, to make an example. I leave this as an exercise for the reader.
-------------------------------------------
"Calculus is just the meaningless manipulation of higher symbols"
-unknown F student