PDA

View Full Version : How can I retain entered data on a page after the user moves to the next page


eck35
08-12-2003, 10:01 PM
How can I retain entered data on the previous page after the user moves to the next page. I want to allow the user to go forward and backward through multiple pages and let them make changes to the data before posting it with a submit button on the last page?

Any input or direction would be greatly apprieciated.
Much thanks.

eck!

requestcode
08-13-2003, 01:08 PM
You will probably have to use cookies to retain the information and then whenever they go to the page check if the cookie is available an if it is populate the form with the info. Here is a link to JavaScript Kits tutorials:
http://www.javascriptkit.com/javatutors/index.shtml

There is a tutorial on session only cookies that might help.

eck35
08-14-2003, 02:44 PM
CF, thank you for the response, it looks like the right direction I needed. I'll let you know how it turned out. Once again, thank you.

eck
:thumbsup:

Vincent Puglia
08-14-2003, 03:04 PM
Hi,

If you have too much data, a cookie solution may not be feasible, so here are 2 other alternatives:

1) use frames -- you can keep each page's data in a 'hidden' frame (cols=rows=0)
2) pass the data within an array to the next page --location.href="page2.html?myArray...)

Vinny

Kor
08-15-2003, 10:43 AM
.... and, of course,

3) use a CGI...:-)
...

Vincent Puglia
08-25-2003, 08:39 PM
Hi eck,

I'm posting here rather than through PM's for 3 reasons:
1) the question was first asked here;
2) someone else may have the same problems and/or a different solution
3) if I do something off the boards, I expect to get paid for it.

use frames -- you can keep each page's data in a 'hidden' frame (cols=rows=0)

create a frame where you set the rows and cols equal to 0. That essentially makes the frame 'hidden' from casual view. Load a page into it that contains variables for all of the fields that are in the 15+ pages and functions to validate before you change any value. Whenever the user clicks 'submit', 'next page', whatever, you pass the current page's contents to the hidden frame; something like:

parent.hideFrame.document.validateForm(this.form)

(Since I don't know how your frames are and will be set up, I cannot give you an exact DOM path for the frames.)

When you get to the last page have a submit or regular button that not only passes the final bits of data, but also submits the form

Vinny