1.0.9 • Published 3 years ago

@ageesea/micro-form v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Micro helper for HTML Forms

A collection of helper methods for manipulating html form through JS.

Install

In your terminal, run

npm install @ageesea/micro-form

Usage

Method: getFormValues(formSelector, isExcludeEmpty=false)

A method that scans your html form inputs to create an object structure. It uses the name attribute as key and their value as value. It also support array-based names.

<!-- example.html -->
<form id="form-employee">
    <input name="full_name" />   
    <input name="age" />   
    <input name="accounts[]" />   
    <input name="accounts[]" />   
</form>
// example.js
import {getFormValues} from '@ageesea/micro-form'

const values = getFormValues('#form-employee')

Output:

{
    full_name: "Juan dela cruz",
    age: 23,
    accounts: [
        "value1", "value2"
    ]
}
1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago