Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Prevent back button in Chrome/Edge/IE to reset select value?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #257211
    hotjava
    Participant

    I’m working on a filter that return hits based on values in different select boxes. When you click back in Firefox (54) the values are still present. But in Chrome/Edge/IE the select boxes are reset to blank/default value.

    Is there any way to prevent and store the selected values somehow? Mabye with local storage?

    #257216
    Atelierbram
    Participant

    Local storage could work, or session storage developer.mozilla.org/es/docs/Web/API/Window/sessionStorage. Why not try this out in a demo?

    #257217
    hotjava
    Participant

    I’m testing a solution with sessionstorage, which as I understand it stores data in the tab as long as it’s open.

    Example here

    https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_webstorage_session

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.