Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
|
Is it the case I need the Javascript writing from EACH page to a hidden CGI page / script (server side) to "remember" the information selected on the first page? Or does Javascript do this for you?
|
No, you have to take every steps to memorize the value at each steps.
The web is created on a "fire and forget" model.
It's not an application that starts, run, and then die. Each pages start, run and dies.
So, the javascript present in one page has no idea what was done previously.
Which means that you have to use the server side to track what informations are important to you, and to give them each time to each javascript in each pages you would need this information.
In your case, it means that you must carry each value from each pages to the next.
I usually use the PHP session mechanism for that.
1 page is presented to the user, he does something in it.
When he submit it, I store the values in $_SESSION and redirect to the next page.
From that other page, I fetch the values from $_SESSION, display the form.
The user makes his choices, submit this page, and I store again the new informations in the session.
When I hit the final page, I (should) have everything needed in the session, and once the checkout is done, clear them to avoid a "back" button hit to relaunch the order.
__________________
Only a biker knows why a dog sticks his head out the window.
|