Fork me on GitHub

It depends on jQuery 1.3 and is available under a MIT license.

Demo #1 Full form autosave

Features

Known bugs

Todo

Here's a list of features that may or may not be implemented in future releases (no specific versions).

Contributors

Misc

There are no limitations. Do whatever you want with this plugin. If you did some nice modifications, just let us know (via Github). We'd be happy to review them, and perhaps include them.

  • url

    Type:
    String, null
    Default:
    form.action

    When url is specified, the forms action attribute will be overriden by the supplied url.

    Code examples

    Initialize an autosave with user specified url.
    $('input').autosave({ url: '/myurl' });
  • method

    Type:
    String, null
    Default:
    form.method

    Override forms default action (post/get)

    Code examples

    Override default action
    $('input').autosave({method:'get'});
  • grouped

    Type:
    boolean
    Default:
    false

    When grouped is set to false autosave will not group all elements matching selector but instead only send the one single node it was triggered upon (onchange/onclick).

    If set to true it will group every element matched by selector and send each value as data when the request is sent to the server

  • dataType

    Type:
    String
    Default:
    'json'

    Define what content type to expect to be returned by the url used for autosave.

    Can be any jQuery content type.

  • send

    Type:
    Function, null
    Default:
    false

    Supply a callback method to be used while sending ajax request.

    Code examples

    Specify a custom handler while sending data.
    $('input').autosave({
                                        send: function(changedNode) {
                                            // Do some pretty spinner visualization here
                                        }
                                    });
  • success

    Type:
    Function, null
    Default:
    null

    Callback on success from ajax request.

    Code examples

    Specify a custom handler to run when success is received.
    $('input').autosave({
                                        success: function(data) {
                                            // Show some confirmation to user
                                        }
                                    });
  • error

    Type:
    Function, null
    Default:
    null

    Callback on error from ajax request.

    Code examples

    Specify a custom handler to run when error is received.
    $('input').autosave({
                                        error: function(data) {
                                            // Show a warning that something failed
                                        }
                                    });

Autosave currently supports no methods

Autosave currently doesnt implement events that can be added after initialization time