In a session, I'm looking for a way to preserve form variables when using the 'Back' and 'Forward' buttons:
I have three pages: A, B, and C. Each page has a form. Page A's submit button goes to Page B. Page B's submit button goes to Page C. Ideally, when a user fills out Page A, submits it, fills out Page B, and submits it, we'd like to have all these form variables saved so that clicking any combination of the 'Back' and 'Forward' buttons will not "lose" the data on the forms in Pages A and B.
Here's what I can accomplish so far:
- Fill out the form on Page A and submit.
- That brings us to Page B. Fill out the form on Page B and submit.
- That brings us to Page C. Click the 'Back' button, bringing us back to Page B. At this point, Page B's form fields are all filled in properly.
- Click the 'Back' button again, bringing us back to Page A. At this point, Page A's form fields are all filled in properly.
- Now I'd like to be able to submit or click the 'Forward' button and have all of Page B's form fields filled in, but I can't seem to do that.
If anyone has a slick way to do this, please let me know. And if you have sample code that does it, I'd be very interested to see it. Thanks!