Problem
You have some javascript where the user has selected some values you intend to persist when the user presses reload.
Solution
Have a form with a hidden field
<input id="someId" type="hidden" />
Set the value with
document.getElementById("someId").value=someValue;
Get the value with
someValue=document.getElementById("someId").value;
NB!If you dynamically add and remove input elements to the form as part of the javascript code, make sure the hidden fields are placed before any of the dynamic elements. The values are saved in the order the fields had when the user clicked to reload, and they are restored in the order the fields have initially, so if you have added fields before the hidden ones, the values are shifted to other fields.
Tags: javascript