user2132913
user2132913

Reputation: 35

How to stop Chrome from archiving dropdown selection

On the following page:

http://www.ftkfranchise.com/franchise-opportunity/

you can select a country, and it will automatically take you to the correct page. You can then hit the back button and scroll down, select another country, and it works again-correctly, in all browsers, except Chrome. In Chrome, when you hit the back button and try to scroll, it takes you to the country that is pre-selected. It doesn't allow you to use the scroll bar. I searched on here for how to clear the dropdown list, and tried this solution:

How to reset dropdown list <select> on 'back' button of browser using Javascript?

and it works in all browsers except Safari - in Safari, when you go back the dropdown list is empty. So, how do I force Chrome to ignore the previous selection in the dropdown list like all other browsers.

Thanks

Upvotes: 1

Views: 600

Answers (1)

dln385
dln385

Reputation: 12100

<script>
function reset_options() {
    document.getElementById('franchise_select').selectedIndex = -1;
    return true;
}
</script>
<body onbeforeunload='reset_options()'>

Upvotes: 2

Related Questions