Keeping text in input fields

Hey everyone!
Sometimes after I’ve typed some long, long text into an input field I accidentally navigate away from the page. And when I press ‘back’, good sites keep my old text in the input field (bad sites don’t). I want to build a good site with Meteor, so how do I embed that functionality?
Note: I would like not to use Users collection for storing input.

You could use a separate collection or one of the many packages that let you use the browser’s local storage.

Regardless of where you store it, it’s simply a matter of periodically pushing whatever is in the input field into that storage method and then checking whenever the user returns if you should pull that information back into the field or not.

1 Like

As said by nkrisc you could put the session state in browser’s localstorage.
Or you could store this state on the server with a collection, that way the state would be preserved even with another browser on another computer…

1 Like