1.0.1 • Published 4 years ago

form-serialize-all v1.0.1

Weekly downloads
100
License
APACHE 2.0
Repository
github
Last release
4 years ago

codecov Build Status

Index

Installation

yarn

yarn add form-serialize-all

npm

npm install --save form-serialize-all

Usage

<form action="" class="example-form">
  <input type="text" value="My awesome name" name="name" />
  <input type="text" value="My awesome surname" name="surname" />
  <input type="checkbox" value="I am the most modest person in the world" name="modest" checked="" />
</form>
import SerializeForm from 'form-serialize-all';

const myFormElement = document.querySelector('.example-form');
const seralize = new SerializeForm(myFormElement);

console.log(seralize.toArray()); // [{name:'My awesome name'}, {surname:'My awesome surname'}, {modest:'I am the most modest person in the world'}]
console.log(seralize.toObject()); //{name:'My awesome name', surname:'My awesome surname', modest:'I am the most modest person in the world'}
console.log(seralize.toString()); // 'name=My awesome name&surname=My awesome surname&modest=I am the most modest person in the world'
1.0.1

4 years ago

1.0.0

4 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago