webforms.save-restore

1.0.1 • Public • Published

webforms.save-restore

Bower version npm version Build Status

Save and Restore form values using HTML5 localStorage.
Demo

Before HTML5, application data had to be stored in cookies, included in every server request. Local storage is more secure, and large amounts of data can be stored locally, without affecting website performance. Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server. Local storage is per domain. All pages, from one domain, can store and access the same data.

Additional reading
Mozilla Developer Network

Getting started

You may install using package managers, or download project archive.
Installing via bower will bring in the dependencies as well.

bower install webforms.save-restore
npm install webforms.save-restore

Usage

$(function() {
    $("form")
    .on("click", ".save", webforms.save)            // save
    .on("click", ".restore", webforms.restore)      // restore
    .on("submit", function(event) {
        event.preventDefault();
        webforms.clean.call(this);                  // clean
                                                    // do something else
    });
});

Dependency

bower install --save jQuery

Browser support

  • Chrome
  • Firefox
  • Safari
  • IE 10+

License

This software is free to use under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i webforms.save-restore

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bcorreia