urbanxtremes
11-28-2006, 09:03 AM
I am writing a cookie (session base) based form that has 3 steps.
1st step: Title, 1st Name, Last Name, and a couple of selects (test_step1.html)
2nd step: Address details (test_step2.html)
3rd step: Displays both cookies ready to be sent (test_step3.html)
Now, the issues seems to lie in the fact, that I can pass step-1 cookie to step-2, but when I go to step-3 it only shows step-2 twice…
I have no idea why this is not working, would really appreciate some help.
Step 1
function process(){
var sal = document.form1.sal.value;
var firstname = document.form1.firstname.value;
var lastname = document.form1.lastname.value;
var investor = document.form1.investor.value;
var type = document.form1.type.value;
var hedge = document.form1.hedge.value;
var fund = document.form1.fund.value;
var other = document.form1.other.value;
var step1 = " Dear " + sal + " " + firstname + " " + lastname + " <br>Registering for " + investor + " <br> " + type + " <br> " + hedge + " <br> " + fund + " <br> " + other + " ";
//step1 = escape(document.cookie);
document.cookie = escape(step1);
window.location = "test_step2.html";
}
Step 2
<script language="JavaScript">
var step1 = unescape(document.cookie);
</script>
<SCRIPT type="text/javascript">
function process2(){
var address1 = document.form2.address1.value;
var address2 = document.form2.address2.value;
var country = document.form2.country.value;
var postal = document.form2.postal.value;
var contact = document.form2.contact.value;
var fax = document.form2.fax.value;
var email = document.form2.email.value;
var cemail = document.form2.cemail.value;
var password = document.form2.password.value;
var memorable = document.form2.memorable.value;
var step2 = " <br> " + address1 + " <br> " + address2 + " <br> " + country + " <br> " + postal + " <br> " + contact + " <br> " + fax + " <br> " + email + " <br> " + cemail + " " + password + " <br> " + memorable +" ";
document.cookie = unescape(step2);
window.location = "test_step3.html";
}
</SCRIPT>
Step 3
<script language="JavaScript">
var step1 = unescape(document.cookie);
</script>
<script language="JavaScript">
var step2 = unescape(document.cookie);
</script>
</head>
<body>
<script language="JavaScript">
document.write (step1);
</script>
<p></p>
<script language="JavaScript">
document.write (step2);
</script>
Here is an example of what I am trying to do:
http://www.markhebblewhite.net/Cookie_Form/test_step1.html
I hope someone can help me please? :confused:
1st step: Title, 1st Name, Last Name, and a couple of selects (test_step1.html)
2nd step: Address details (test_step2.html)
3rd step: Displays both cookies ready to be sent (test_step3.html)
Now, the issues seems to lie in the fact, that I can pass step-1 cookie to step-2, but when I go to step-3 it only shows step-2 twice…
I have no idea why this is not working, would really appreciate some help.
Step 1
function process(){
var sal = document.form1.sal.value;
var firstname = document.form1.firstname.value;
var lastname = document.form1.lastname.value;
var investor = document.form1.investor.value;
var type = document.form1.type.value;
var hedge = document.form1.hedge.value;
var fund = document.form1.fund.value;
var other = document.form1.other.value;
var step1 = " Dear " + sal + " " + firstname + " " + lastname + " <br>Registering for " + investor + " <br> " + type + " <br> " + hedge + " <br> " + fund + " <br> " + other + " ";
//step1 = escape(document.cookie);
document.cookie = escape(step1);
window.location = "test_step2.html";
}
Step 2
<script language="JavaScript">
var step1 = unescape(document.cookie);
</script>
<SCRIPT type="text/javascript">
function process2(){
var address1 = document.form2.address1.value;
var address2 = document.form2.address2.value;
var country = document.form2.country.value;
var postal = document.form2.postal.value;
var contact = document.form2.contact.value;
var fax = document.form2.fax.value;
var email = document.form2.email.value;
var cemail = document.form2.cemail.value;
var password = document.form2.password.value;
var memorable = document.form2.memorable.value;
var step2 = " <br> " + address1 + " <br> " + address2 + " <br> " + country + " <br> " + postal + " <br> " + contact + " <br> " + fax + " <br> " + email + " <br> " + cemail + " " + password + " <br> " + memorable +" ";
document.cookie = unescape(step2);
window.location = "test_step3.html";
}
</SCRIPT>
Step 3
<script language="JavaScript">
var step1 = unescape(document.cookie);
</script>
<script language="JavaScript">
var step2 = unescape(document.cookie);
</script>
</head>
<body>
<script language="JavaScript">
document.write (step1);
</script>
<p></p>
<script language="JavaScript">
document.write (step2);
</script>
Here is an example of what I am trying to do:
http://www.markhebblewhite.net/Cookie_Form/test_step1.html
I hope someone can help me please? :confused: