View Full Version : Need help with form

08-06-2002, 03:35 PM
I made a form in which all the variables are copied into a next page. There the variables are restored, however, they cannot be sent. It looks like though they are restored they are no longer initiated or something as known inputvariables. Can someone tell me how to sent these inputvariables anyway?


<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">