Skip to content
An easy-to-use library that provide acronymous sending on form changes
JavaScript Other
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
grunt
lib
src
test
.editorconfig
.eslintrc.json
.gitignore
.npmignore
.travis.yml
Gruntfile.js
LICENSE
README.md
package.json

README.md

Form Async

Build Status

Form Async is an easy-to-use library that provide acronymous sending on form changes. It's a great solution to preventing data loss when filling out a web form.

Features

  • Lightweight (~1.5kb gziped)
  • Saves any HTML form element
  • Support content editable property
  • Full customization
  • Retry functionality if ajax request fail
  • Send form elements as group of field
  • Provide the way to validate changes before sending ajax request
  • Heavily tested

Installation

$ npm install form-async

We recommend installing from npm and then using a module bundler such as RequireJS, Webpack or Browserify.

Alternatively, you can use jsdelivr CDN instead of npm.

<!-- 1. Add JS before the closing `</body>` -->
<script src="jquery.js"></script>
<script src="form-async.js"></script>

<!-- 2. Initialize -->
<form action="/ajax/account">
   <input name="xs_username">
</form>

<script>
   $("form").async();
</script>

Documentation

Read the docs for more details on how to use Form Async.

Callbacks

  • before — pre-request function that can be use to validate data before it is sent
  • success — function invoked if the request succeeds
  • error — function invoked if the request fails

Software

We use Browserstack for manual testing BrowserStack logo

You can’t perform that action at this time.