Image Image Image Image Image

Fish Can’t Whistle Limited

Registered Company Number: 7781289

Studio 30
Fazeley Studios
191 Fazeley Street
Birmingham
West Midlands
B5 5SE

 

Scroll to Top

To Top

development

jQuery Plugin – saveForm

On 09, Nov 2012 | 2 Comments | In development, jquery, jQuery Plugins | By Andy

jQuery plugin, saveForm is a that allows you to specify form fields to be saved in a cookie for the next time a user visits the form.

To set up the plugin include jQuery, then include either the full or minified version of the plugin (both included in the zip below).

Initiate the jquery plugin like this-

jQuery.saveForm();

There are two options you can pass through. The first is whether to debug or not and is a boolean.

jQuery.saveForm(true);

The second option you can pass is a comma separated string of elements to exclude from the plugin. For example, you may not want to include the user’s paypal email address. In which case you would do this-

jQuery.saveForm(true, '.paypal_email');

Where “paypal_email” is the class of the input to exclude.

The below zip contains full and minified versions of the saveForm jquery plugin.

Download the Zip here

Submit a Comment

Comments

  1. Does your plugin work on a jQuery Mobile page. In the past I have setup auto saves with the following script. i have placed your plugin in the

    I am unsure of where the jQuery.saveForm(); is placed in the DOM.

    Thanks in advance and sorry to bother you as i am still new to this programming.

    Tom

    • Andy

      Hi Thomas

      Yes it should work. As long as you place it within a document ready function it doesn’t matter where you put it. :-)