Cyberomin
Cyberomin

Reputation: 523

Holding the previous state of a select field after page reload

I have an HTML for with a select field - drop down list. When a user makes a mistake and goes back there the data selected by the user is lost and show the original message. Is there a way of holding this state, so I don't get the user to select this every time he or she makes a mistake. Thanks. Hi people when you fill a form in Safari and submit to a preview page, when you click back it takes you to the original form and still shows the selected item against asking you yo select anything fresh, for some reasons what soever, Firefox does not do this, it there a way to make it do this, so that one can have a uniform experience on different platform

Upvotes: 0

Views: 883

Answers (2)

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114367

This article sums it up pretty well.

You can also use window.name to stash string data. Put some sort of token and your selected index in there and check for a value in window.name on page load.

Upvotes: 0

sanders
sanders

Reputation: 10888

You might be interested in this post. This is your question How to remember last state with Jquery?

Upvotes: 1

Related Questions