seemple-parse-form
The function binds named HTML form fields (input, select, textarea etc) contained at given HTML form to corresponding properties.
const object = {};; // ...console; // 'foo'objectx = 'bar'; // changes input value to 'bar'
Usage
In browser environment (or whatever environment where Seemple
is global variable) Seemple
is extended.
Seemple;
The bundle can be downloaded at gh-pages branch
In CJS environment Seemple
is not extended.
npm install seemple-parse-form
const parseForm = ;
API
The function accepts 4 arguments:
object
- an object (required)form
- a selector, DOM node etc. of given form (custom selectors:sandbox
and:bound(XXX)
also acceptable) (required)callback
- a function which will be called on every found field; accepts field name and field element itselfeventOptions
- event options which will be passed to every internal call ofbindNode
.
Returns: parsed form element.
The third argument is useful when parseForm
is used with Seemple.Object
: you can call addDataKeys
method there.
const form = ;