JQUERY form temporary function plug-in sharing _ jquery

Source: Internet
Author: User
Tags custom name
Today I want to introduce a jQuery plug-in: jquery. formLocalStorage. js. With this plug-in, we can easily implement the form temporary storage function jquery. formLocalStorage is a jquery plug-in that implements the general form temporary storage function

Principle:

Monitors changes in form fields, uses localStorage in HTML5 WebStorage to store the values of these changed form fields, and loads the stored values back to the form field when loading the form, this allows for temporary storage.

Features:

1. Do not use server-side storage to save server resources.

2. The code is concise. If you use the default configuration, you only need a short piece of code $ ("# your_form_id"). formLocalStorage ();. You do not need to write a large volume of server logic.

3. rich configuration items and default values. You can use the configuration items to customize the style of the temporary content, the callback events after the temporary content is loaded, stored, and deleted, and the temporary storage naming rules, you can also use the default value to reduce excessive configuration work.

Usage:

1. Use the Default Configuration:

$("#your_form_id").formLocalStorage();

2. Use custom Configuration:

$ ("# Your_form_id "). formLocalStorage ({storage_name_perfix: 'Your _ storage_name_perfix', // custom name prefix storage_events: 'click' // custom temporary storage trigger event });

Known issues:

1. The content of some dynamically written form items cannot be monitored or saved temporarily.

2. the default storage_name_perfix is this. context. URL + form_selector + "@", if this. context. if the URL changes, the temporary storage cannot be located. It is best to use another unique value as the default storage_name_perfix.

Plug-in download http://xiazai.jb51.net/201602/yuanma/jquery.formLocalStorage (jb51.net).zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.