Preserve Data Values

  • Thread starter Bruce A. Julseth
  • Start date
B

Bruce A. Julseth

Page A is an input data page. Before all the data input is complete, a user
might have to call an intermediate page B. After completing page B, page B
will return the user to A. The problem. The values entered on page before
the user called page B, are lost. I "think" I read somewhere that to
preserve the values, I save use Cookies.

Is that correct? Is there any other way?

Thanks....

Bruce
 
R

RobG

Page A is an input data page. Before all the data input is complete, a user
might have to call an intermediate page B. After completing page B, page B
will return the user to A. The problem. The values entered on page before
the user called page B, are lost. I "think" I read somewhere that to
preserve the values, I save use Cookies.

Is that correct?

You could save data in a cookie, then re-establish it when the user
returns to the page however it is not particularly robust.

Is there any other way?

You can manage the session at the server so that when the form is
submitted in the first place, the server remembers the values and re-
populates the form when the user returns.

You can also submit the values to the second form and keep them in
hidden fields, then submit them again when you return to the first
form.

You could make use of the new features of HTML 5 and use a client-side
database - available in Safari 3.1 and Gecko 1.9 (Fx 3.0?):

<URL: http://www.w3.org/html/wg/html5/#sql >
 
L

Laser Lips

Yeah send them in the URL and use JavaScript to pick off the query
string.

OR

Cheat and store the values in window.name;

PAGE A.html
<script ...>
window.name="HELLO FROM A";
</script>

PAGE B.html
<script ...>
alert(window.name); //produces 'HELLO FROM A'
</script>
 
B

Bruce A. Julseth

Page A is an input data page. Before all the data input is complete, a
user
might have to call an intermediate page B. After completing page B, page B
will return the user to A. The problem. The values entered on page before
the user called page B, are lost. I "think" I read somewhere that to
preserve the values, I save use Cookies.

Is that correct?

You could save data in a cookie, then re-establish it when the user
returns to the page however it is not particularly robust.

Is there any other way?

You can manage the session at the server so that when the form is
submitted in the first place, the server remembers the values and re-
populates the form when the user returns.

You can also submit the values to the second form and keep them in
hidden fields, then submit them again when you return to the first
form.

You could make use of the new features of HTML 5 and use a client-side
database - available in Safari 3.1 and Gecko 1.9 (Fx 3.0?):

<URL: http://www.w3.org/html/wg/html5/#sql >


--
Rob

I like both your suggestions. I know how to do the second suggestion, hidden
fields. The first one I'm not sure how to do it, off the top of my head. I
am using PHP on the serverside. so I guess I need to get the form fields to
some $_SESSION vars?

Thenks...

Bruce
 
B

Bruce A. Julseth

Laser Lips said:
Yeah send them in the URL and use JavaScript to pick off the query
string.

OR

Cheat and store the values in window.name;

PAGE A.html
<script ...>
window.name="HELLO FROM A";
</script>

PAGE B.html
<script ...>
alert(window.name); //produces 'HELLO FROM A'
</script>

Sneaky!! I think I'll look at Rob's approach first.

Thanks for the response.

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top