Hi, I have just started learning javascript and would really like some help.

I am making an online Reading test that is 2 pages long. I want to transfer the answers from the first page to the next page. So that when the user hits submit on the second page all the results are collated.

}
</script>
</head>
<body onload="loadvars">
<h1 style="font-family:arial;color:rgb(174, 16, 61);">King's Reading Assessment</h1>
<p style="font-family:arial"><b>Part Two</b></p>
<p style="font-family:arial"><b>Read the information below and answer Questions 13 – 20. You have 15 minutes to complete Part 2.</b></p>
<p style="font-family:arial"><b>Questions 13 – 19</b></p>
<p style="font-family:arial">Complete each of the statements with the best ending (A – G) from the box on the right. Write your answers in the spaces provided on the Answer Sheet.</p>
<table border="1">
<tr><td>
<table cellpadding="3" style="font-family:arial">
<tr>
<td>A</td>
<td>
we must use our brains if we wish to maintain our memories and brain function.</td>
</tr>
<tr>
<td>B</td>
<td>they improve their chances of maintaining their memory and mental functions.</td>
</tr>
<tr>
<td>C</td>
<td>our reactions become slower</td>
</tr>
<tr>
<td>D</td>
<td>using their brain and stretching their mental faculties</td>
</tr>
<tr>
<td>E
</td><td>it becomes harder to learn new skills</td>
</tr>
<tr>
<td>F</td>
<td>because the temporal lobes are particularly vulnerable to the effects of ageing.</td>
</tr>
<tr>
<td>G</td>
<td>brain cells</td>
</tr>
</table>
</td></tr></table>
<br />
<form style="font-family:arial" id="answers" action="ReadingTestPart2.html">
<table cellpadding="3"><tr><td>
13. Neurons can be best described as....
</td><td>
<input type="text" maxlength="1" size="1" name="13. Neurons can be best described as...." />
</td></tr>
<tr><td>
14. Research indicates that...
</td><td>
<input type="text" maxlength="1" size="1" name="14. Research indicates that..." />
</td></tr>
<tr><td>
15. As the temporal lobes of the brain are affected by ageing...
</td><td>
<input type="text" maxlength="1" size="1" name="15. As the temporal lobes of the brain are affected by ageing..." />
</td></tr>
<tr><td>
16. A person can keep their brain active by...
</td><td>
<input type="text" maxlength="1" size="1" name="16. A person can keep their brain active by..." />
</td></tr>
<tr><td>
17. If a person’s brain is kept active...
</td><td>
<input type="text" maxlength="1" size="1" name="17. If a person’s brain is kept active..." />
</td></tr>
<tr><td>
18. We take longer to learn a new language as we get older....
</td><td>
<input type="text" maxlength="1" size="1" name="18. We take longer to learn a new language as we get older.... " />
</td></tr>
<tr><td>
19. As the neurons in the brain become less efficient...
</td><td>
<input type="text" maxlength="1" size="1" name="19. As the neurons in the brain become less efficient..." />
</td></tr>
</table>
</form>
<p style="font-family:arial"><b>Question 20</b></p>
<p style="font-family:arial">Which THREE of the following are given in the text? Please select from the options below.</p>
<form action="" style="font-family:arial">
<table cellpadding="3">
<tr><td>
A description of the ways in which mental function changes as we get older
</td><td>
<input type="checkbox" name="a description of the ways in which mental function changes as we get older" value="a description of the ways in which mental function changes as we get older" />
</td></tr>
<tr><td>
An explanation of how mental decline can be limited
</td><td>
<input type="checkbox" name="an explanation of how mental decline can be limited" value="an explanation of how mental decline can be limited" />
</td></tr>
<tr><td>
An explanation for why people go bald and grey with age
</td><td>
<input type="checkbox" name="an explanation for why people go bald and grey with age" value="an explanation for why people go bald and grey with age" />
</td></tr>
<tr><td>
A description of various parts of the brain and their function
</td><td>
<input type="checkbox" name="a description of various parts of the brain and their function" value="a description of various parts of the brain and their function" />
</td></tr>
<tr><td>
A detailed report showing results of several research projects
</td><td>
<input type="checkbox" name="a detailed report showing results of several research projects" value="a detailed report showing results of several research projects" />
</td></tr>
</table>
<br />
<br />
<input type="submit" value="Submit" />
</form>

</body>

</html>

05-18-2009, 05:27 PM

beth0902

Is there anyone who can help me please?

05-18-2009, 06:35 PM

Y_Less

Use a hidden input for each variable you want to pass and set their values to the values of the variables on submission:

Never rely on clients to implement any important functionality; simply submit their answers to the server and do the calculations there.

05-18-2009, 09:15 PM

ZeroKilled

@beth0902:
first, important detail! next time you paste code, and specially when it is long, enclose them in BBCode tag [code]...[/code]. is more easier to read code in proper display because it use monospaced font and it will prevent the system board from parsing certain characters which will break your code. when board parse those chars, is hard to anyone to spot the bug in your code.

i agree with Y_Less. however, i also understand that you're learning javascript. so i guess you will still looking for the solution in javascript. first thing you have to fix is the structure of your form. radio button are meant to select a single option within a group. to do so, you have to give each inputs group the same value in name attribute.

05-19-2009, 06:26 PM

beth0902

Thanks!

Thank you everyone.

Yes I will try and edit my posts and put the code into one of those boxes.

By the way what is the code for displaying results in a new window? I've tried searching everywhere but I can't find something that I could use.

05-19-2009, 06:33 PM

beth0902

By the way

By the way, dumb question I know, how do you edit your own posts? I cannot find an edit button!

05-20-2009, 12:39 AM

ZeroKilled

after you create a new window with open method and store the returned reference you can begin displaying the information using the stored reference. isn't quite a good solution but you can 'write' to that window with write method. you can pass anything, even html code and/or variable with primitive value (number, string, boolean), and the browser will render it. try following those link, along with the example, which explain how you would use the methods.

regarding the ability to edit post, each forum have their own rules. in WD, you have 30 minutes or so to edit your post after sending it. once time expire, you can't edit the post.