1.0.5 • Published 6 years ago

form-2-json v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

yarn add form-2-json

input fields inside the form, must have name attribute, like -

<input name='age' />

import { form2json } from 'form-2-json'
form2json(event.target)

this function will return a json

Example

document.querySelecor('form').addEventListener('submit', handleSubmit)
function handleSubmit (e) {
  e.preventDefault()
  let myjson = form2json(e.target)
  console.log(myjson)
}
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago