@f/form-controls

1.0.0 • Public • Published

form-controls

Build status Git tag NPM version Code style

Retrieve a list of control elements from a form

Installation

$ npm install @f/form-controls

Usage

var controls = require('@f/form-controls')

function serialize (form) {
  return controls
    .reduce(function (acc, ctrl) {
      acc[ctrl.name] = ctrl.value
      return acc
    }, {})
}

API

formControls(form)

Returns: An array of input controls within form.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/form-controls

Weekly Downloads

51

Version

1.0.0

License

MIT

Last publish

Collaborators

  • f