strategies for restoring hidden divs when user clicks back button

  • Thread starter gimme_this_gimme_that
  • Start date
G

gimme_this_gimme_that

Depending upon a radio button button's setting a div is either hidden
or visible.

It turns out that the default view of the page requires that the div
be hidden.

When the user opts for the setting that makes the div visible, clicks,
and then clicks the back button the page renders with the div hidden.

I've tried a few strategies to handle this. Adding no-cache meta tags
(not on the server side though and BTW, I'm using JSP), adding a
parameter to the query string on the forwarding page and looking for
it in the request object, looking at the HTTP_REFERRER. Nothing has
worked.

Has anyone run into this issue before and come up with a solution to
this problem?

Thanks.
 
D

David Mark

Depending upon a radio button button's setting a div is either hidden
or visible.

It turns out that the default view of the page requires that the div
be hidden.

When the user opts for the setting that makes the div visible, clicks,
and then clicks the back button the page renders with the div hidden.

I've tried a few strategies to handle this. Adding no-cache meta tags
(not on the server side though and BTW, I'm using JSP), adding a
parameter to the query string on the forwarding page and looking for
it in the request object, looking at the HTTP_REFERRER. Nothing has
worked.

Has anyone run into this issue before and come up with a solution to
this problem?

The code that synchronizes the div with the radio button must be run
on page load (onload event.) This is because browsers persist and
restore the states of form elements.
 
A

ASM

En réponse à (e-mail address removed) qui nous a susurré, en date
du : 25/07/07 0:43, le message sibyllin suivant :
Depending upon a radio button button's setting a div is either hidden
or visible.

It turns out that the default view of the page requires that the div
be hidden.

When the user opts for the setting that makes the div visible, clicks,
and then clicks the back button the page renders with the div hidden.

I've tried a few strategies to handle this. Adding no-cache meta tags
(not on the server side though and BTW, I'm using JSP), adding a
parameter to the query string on the forwarding page and looking for
it in the request object, looking at the HTTP_REFERRER. Nothing has
worked.

Has anyone run into this issue before and come up with a solution to
this problem?

back button is to do what ?

to go back, no ?

so, how do you expect, going in past, to get the present ?


of corse, the referrer will not help you, pressing back button you don't
call precedent display's url, you ask the browser to show this one from
its cache.

I do not understand you'd search a server side solution ...
 
D

dhtmlkitchen

The code that synchronizes the div with the radio button must be run
on page load (onload event.) This is because browsers persist and
restore the states of form elements.

That is a good solution.

Another possibility would be to use location.hash. This won't work
well with multiple divs, though.

location.hash = '#' + activeDivId;

This is useful when you want to come to the page state from a link,
bookmark, or history, too.
 

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

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top