I'm not sure what's been offered in the other forum, but here is a way to do it with pure javascript:
Each of your pages has a series of questions:
<input type="text" name="one">
<input type="text" name="two">
...
Then finally a button to go the next set of questions:
<input type="button" onClick="goToNextPage('next_page.htm',this.form,'');">
The goToNextPage() function could be placed in a .js file that will be included by all pages and would be something like this:
/*** Untested ***/
function goToNextPage(url,f,data)
{
url+="?" + data;
for (var i=0;i<f.elements.length;++i) {
// This assumes that all answers are
// in text boxes, so this
// will have to be modified to allow
// for radio buttons, selection lists etc.
if (f.elements
.type=="text"
{
url+=url.charAt(url.length-1)=="?" ? f.elements.name + "=" + f.elements.value :
"&" + f.elements.name + "=" + f.elements.value;
}
}
self.location.href=url;
}
This would send you to the next page of questions with the questions and answers from the page appended to the URL. Each page after the first page would need to call a function (again, it can be defined in a common .js file) that grabs the questions and answers from the URL:
function parseURL()
{
s=self.location.href;
return s.indexOf("?"
? s.substring(s.indexOf("?"
+1) : "";
}
The return from this can be stored in a global variable:
<body onLoad="data=parseURL();">
Then, on this page (the 2nd page and later), you would call the goToNextPage function like this:
<input type="button" onClick="goToNextPage('next_page.htm',this.form,data);">
And so on...
Eventually, the user will get to the final page (note that the answers to the questions haven't appeared in any files the user has visited up to this point). The final page will call parseURL to grab the block of questions and answers and split them up into question/answer pairs and then compare them against the correct answers which will be hard coded on this page. This will occur in the onLoad() event and the results will be written on the final page. Yes, the user can still get at the answers, but this method encourages the user to stay honest as he/she moves through the series of questions.
I'll leave the question/answer parsing as an exercise to the reader as I'm about to go to sleep 
An alternative to storing the answers in the URL is using cookies which I think would be preferable, but I thought a quasi-form GET javascript would be interesting.
If you really want to keep the answers from the user and do a *real* questionairre, what Tom said is true: use server side scripting. Besides, you can also store users' answers in a database and do all kinds of other neat stuff that you can't do with client-side scripting.
Russ
Russ
bobbitts@hotmail.com