Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autosave forms to local storage #34

Open
jeremydw opened this issue Jan 24, 2017 · 0 comments
Open

Autosave forms to local storage #34

jeremydw opened this issue Jan 24, 2017 · 0 comments
Assignees

Comments

@jeremydw
Copy link
Member

jeremydw commented Jan 24, 2017

A project has requested an "autosave" feature for a form. We should implement a module that autosaves forms to local storage and restores them when the page is reloaded. There should be an API to clear the saved form data.

  • Thinking that the key names could be determined based on the field names.
  • By default, I would say that the form should autosave on keyup, debounced.

Some ideas around sample usage:

<form id="example">
  <input type="text" name="title">
  ...
</form>

var autosave = require('airkit/forms/autosave');

var el = document.getElementById('example');
var options = {...};  // Whatever options we might have.
var autosaver = autosave.init(el, options);
autosaver.clear();  // Clears saved data.
@Zoramite Zoramite self-assigned this Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants