If i use the following code below, it works perfectly on firefox (private window or normal window). I tried to use it on my iphone 6 using safari and it doesnt seem to store my information in normal mode (non private mode)? Maybe the code is not right for safari? Can someone assist me? Thanks!
Code:
<script>
// Run on page load
window.onload = function()
{
// If sessionStorage is storing default values (ex. name), exit the function and do not restore data
if (sessionStorage.getItem('name') == "name")
{
return;
}
// If values are not blank, restore them to the fields
var name = sessionStorage.getItem('name');
if (name !== null) $('#playlisthiddenfield').val(name);
}
// Before refreshing the page, save the form data to sessionStorage
window.onbeforeunload = function()
{
sessionStorage.setItem("name", $('#playlisthiddenfield').val());
}
</script>
Basically the issue is, once i refresh the information in the input field disappears where as in firefox it stays (Which i want it to).