By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Preserve Data Values

P: n/a
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
Aug 8 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Aug 8, 11:20*am, "Bruce A. Julseth" <julebj_nos...@bellsouth.net>
wrote:
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
Aug 8 '08 #2

P: n/a
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>
Aug 8 '08 #3

P: n/a

"RobG" <rg***@iinet.net.auwrote in message
news:86**********************************@t1g2000p ra.googlegroups.com...
On Aug 8, 11:20 am, "Bruce A. Julseth" <julebj_nos...@bellsouth.net>
wrote:
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
Aug 8 '08 #4

P: n/a

"Laser Lips" <lo*********@gmail.comwrote in message
news:df**********************************@d77g2000 hsb.googlegroups.com...
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
Aug 8 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.