forbject
** CommonJS/Browserified simple form object data mapping, without magic **
Forbject creates key/value pairs from form elements. This is a quick and simple vanilla JS way to map data without the baggage of a full framework.
Example
Check out example/index.html
, the example javascript for the example page is resources/js/example_src.js
Installation
$ npm install forbject
Forbject is a browserified/commonjs javascript module.
Usage
JavaScript
var forbject = myforbject; var { forbject1= new;}; //initialize nav component after the dom has loadedwindow;
HTML
Your Page Field 1 Field 2
API
//update form elements to JSON from Form elementmyforbject; //get form objectmyforbject; //eventsmyforbject; // callback()myforbject; // callback(data)myforbject; // callback(data)
Development
Make sure you have grunt installed
$ npm install -g grunt-cli
Then run grunt watch
$ grunt watch
For generating documentation
$ grunt doc
$ jsdoc2md lib/**/*.js index.js > doc/api.md
Notes
- The Forbject Module uses Node's event Emitter for event handling.