strategies for restoring hidden divs when user clicks back button

Discussion in 'Javascript' started by gimme_this_gimme_that@yahoo.com, Jul 24, 2007.

  1. Guest

    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.
    , Jul 24, 2007
    #1
    1. Advertising

  2. David Mark Guest

    On Jul 24, 6:43 pm, ""
    <> wrote:
    > 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.
    David Mark, Jul 24, 2007
    #2
    1. Advertising

  3. ASM Guest

    En réponse à 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 ...

    --
    Stephane Moriaux et son (moins) vieux Mac
    ASM, Jul 24, 2007
    #3
  4. Guest

    On Jul 24, 3:51 pm, David Mark <> wrote:
    > On Jul 24, 6:43 pm, ""
    >
    >
    >
    > <> wrote:
    > > 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.


    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.
    , Jul 25, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BillE
    Replies:
    0
    Views:
    378
    BillE
    Oct 17, 2006
  2. Rick
    Replies:
    3
    Views:
    8,101
    Alexey Smirnov
    Apr 13, 2010
  3. PontiMax

    Clicks and double-clicks

    PontiMax, Jul 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    177
    Eliyahu Goldin
    Jul 14, 2004
  4. morc
    Replies:
    4
    Views:
    169
    Thomas 'PointedEars' Lahn
    Feb 14, 2006
  5. Badass Scotsman
    Replies:
    1
    Views:
    174
    Randy Webb
    Apr 27, 2006
Loading...

Share This Page