Skip to content

donburks/jQuery-Elephant

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Elephant

The idea behind jQuery Elephant is that forms should be able to store their data locally in the browser without having to worry about a page closure or accidental navigation away causing any problem with the form data being erased.

Long forms can be very tedious for a user, particularly if they have to enter them in multiple times.

However, as a developer, you don't want to have to weigh your page down with a very heavy library to accomplish this.

jQuery Elephant is 1.8KB uncompressed, and only 934B minified!

Usage:

Include the script on your page, after jQuery:

	<script src="jquery.elephant.min.js"></script>

In your document ready, bind to your form object directly:

	$("#myForm").elephant();

And that's it.

Options

There is only one option that is able to be passed to the plugin. This is the key that will be used by the plugin to store the form data in localStorage. This gives you the ability to store data separately for each form.

Example:

	$("#myForm").elephant({key: 'form1'});

	$("#myOtherForm").elephant({key: 'form2'});

About

jQuery Elephant is a jQuery plugin enabling localStorage to retain form values across page loads.

Resources

Stars

Watchers

Forks

Packages

No packages published