{"id":20081261,"url":"https://github.com/depuits/jquery.autosaveform","last_synced_at":"2025-05-06T00:31:07.179Z","repository":{"id":57282510,"uuid":"87809501","full_name":"depuits/jQuery.AutoSaveForm","owner":"depuits","description":"jQuery plugin for auto saving forms while editing.","archived":false,"fork":false,"pushed_at":"2017-12-29T09:18:07.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T09:41:55.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/depuits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-10T12:42:34.000Z","updated_at":"2024-01-02T09:08:16.000Z","dependencies_parsed_at":"2022-09-11T16:31:03.562Z","dependency_job_id":null,"html_url":"https://github.com/depuits/jQuery.AutoSaveForm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2FjQuery.AutoSaveForm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2FjQuery.AutoSaveForm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2FjQuery.AutoSaveForm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2FjQuery.AutoSaveForm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/depuits","download_url":"https://codeload.github.com/depuits/jQuery.AutoSaveForm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252598230,"owners_count":21774224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T15:34:06.497Z","updated_at":"2025-05-06T00:31:06.914Z","avatar_url":"https://github.com/depuits.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery.AutoSaveForm\njQuery plugin for auto saving forms while editing. To use simply add the following line to your ready function:\n\n```javascript\n$('form').autoSaveForm();\n```\n\n[Demo](https://depuits.github.io/jQuery.AutoSaveForm/demo)\n\n## Install\nYou can download the [jquery.auto-save-form.js](https://raw.github.com/depuits/jQuery.AutoSaveForm/master/jquery.auto-save-form.js) file to include in your page or you can install it using [Bower](http://twitter.github.com/bower/):\n\n```bash\n$ bower install jquery.auto-save-form\n```\n\n##Requirements\njQuery version 1.7 or higher.\n\n## Usage\n```javascript\n\n$(function() {\n\tvar $form = $('form');\n\tvar $formStatusHolder = $('.js-form-status-holder');\n\n    // Enable on all forms\n    $form.autoSaveForm();\n\n    // or with options\n    $form.autoSaveForm({ delay: 2000 });\n\n    // The following triggers confirm to the beforeSend, error and success ajax callbacks.\n\t$form.on('beforeSave.autoSaveForm', function (ev, $form, xhr) {\n\t\t// called before saving the form\n\t\t// here you can return false if the form shouldn't be saved\n\t\t// eg. because of validation errors.\n\t\tif (!$form.valid()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Let the user know we are saving\n\t\t$formStatusHolder.html('Saving...');\n\t\t$formStatusHolder.removeClass('text-danger');\n\t});\n\n\t$adminForm.on('saveError.autoSaveForm', function (ev, $form, jqXHR, textStatus, errorThrown) {\n\t\t// The saving failed so tell the user\n\t\t$formStatusHolder.html('Saving failed! Please retry later.');\n\t\t$formStatusHolder.addClass('text-danger');\n\t});\n\t$adminForm.on('saveSuccess.autoSaveForm', function (ev, $form, data, textStatus, jqXHR) {\n\t\t// Now show the user we saved and when we did\n\t\tvar d = new Date();\n\t\t$formStatusHolder.html('Saved! Last: ' + d.toLocaleTimeString());\n\t});\n});\n\n\n// To manually trigger a save on the form you can call\n$('#my-form').trigger('save.autoSaveForm');\n\n```\n\n### Options\n| parameter     | description                                         | default                                                |\n|---------------|-----------------------------------------------------|--------------------------------------------------------|\n| timeout       | Time delay between input and the saving of the data | 1000                                                   |\n| fieldEvents   | The events on which a save will be initiated        | change keyup propertychange input                      |\n| fieldSelector | Selector for the fields to monitor for changes      | :input:not(input[type=submit]):not(input[type=button]) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepuits%2Fjquery.autosaveform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepuits%2Fjquery.autosaveform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepuits%2Fjquery.autosaveform/lists"}