1.0.0 • Published 4 years ago

serialize-html-form v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Serialize Form

Obtain a serialized object of certain form passing the id as an argument:

serializeForm('my-form');

Document body:

<form id="my-form">
  <input type="text" name="user.name" value="Antonio" />
  <input type="text" name="user.email.primary" />
  <input type="text" name="business" />
</form>

Output:

{
    user: {
      name: 'Antonio',
      email: {
        primary: ''
      }
    },
    business: ''
};