Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

submitter

0.0.7 • Public • Published

submitter

Automatically submitting forms with AJAX

Features

  • Recover all data of inputs in form
  • Recover div content as inputs content
  • Allow submit button outside the form (add target="your-form-name" to your submit input)
  • Use img tags as input[type="file"]

Installation

Download and extract the last release from here or install with Bower

$ bower install submitter

Usage

Link submitter.js from your html file

<script src="path/to/submitter.js"></script>

or load it with browserify in your .js file

var submitter = require("path/to/submitter.js");

Then apply submitter to your form

var options = {
    init : function () {
        // do something on start request
    },
    finish : function () {
        // do something on start request
    },
    progress : function (p) {
        // do something with 'p' (percentaje, number 0-100)
    },
    fail : : function (error) {
        // do something with error after failed request
    },
    success : function (data) {
        // do something with data after successfull request
    }
}
 
submitter('your_form_name', options);




© 2014 jacoborus

Released under MIT License

Keywords

install

npm i submitter

Downloadsweekly downloads

2

version

0.0.7

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability