View Full Version : sending data in a copied form

08-01-2002, 03:02 PM
I use a script which copies the input of a form every time to the next page. This is because i want people to fill in the questions one at the time. Therefor i present 1 questoin and hide the rest. At page 5 all the questions are answered and copied. However, the input isn't sent. Only the last question filled in at page 5. Does someone know why this is and what i can do about it. Otherwise i must let the users copy the data themselves in an other form. This doesn't look very professional.

Here the code i use on the last page:

<TITLE>MyForm resultaten</TITLE>
.save { behavior:url(#default#userdata)};
BODY{font-family : "Comic Sans MS" Technical,"Times New Roman", serif}</STYLE>
//This will save any named attributes in the form myForm
//Assumes unique names
function SaveIt() {
//Create a collection of INPUT elements on the form
oColl = myForm.tags("input");
//Loop through and save them as name, value pairs
for (i = 0; i < oColl.length; i++) {
//Make sure the element has a name
if (oColl[i].name != "")
myForm.setAttribute(oColl[i].name, oColl[i].value);
//Now save the data

function RestoreIt() {
//Load the persisted data
//Walk through the form and set the values
oColl = myForm.tags("input");
for (i = 0; i < oColl.length; i++) {
//Make sure the element has a name
if (oColl[i].name != "") {
temp = myForm.getAttribute(oColl[i].name);
if (temp)
//Set the value
oColl[i].value = temp;
<body onload="RestoreIt()" onunload="SaveIt()" background="back.gif">

<FORM METHOD="post" ACTION="http://psych.fullerton.edu/cgi-win/polyform.exe/generic" NAME="myForm" CLASS="save" >

<INPUT NAME="vraag1" SIZE="8"><br>
<INPUT NAME="vraag2" SIZE="8"><br>
<INPUT NAME="vraag3" SIZE="8"><br>
<INPUT NAME="vraag4" SIZE="8"><br><br>

wat is je leeftijd? <INPUT NAME="vraag5" SIZE="8"> <br><br>
<textarea Rows="3" Cols="40"></textarea>
<input type="submit" value="Verzenden">



Only question 5 (vraag 5) is new on this screen, the rest is filled in earlyer and copied. Howerver, the values are printed in the input, so i know they are there, but only question 5 is sent.