Reputation: 59
If we have an online form to be filled(an application form), an html page and the fields are filled with data and save button is clicked at that very moment the connection to server is lost. How can we preserve the data which was fed in the fields of the html page?
Upvotes: 0
Views: 97
Reputation: 13570
You can store data in localStorage.
localStorage.setItem("someItemName", "Value");
On page load you could check to see if there is any data in localStorage with:
var yourdata = localStorage.getItem("someItemName");
Upvotes: 1