A collection of helper methods for manipulating html form through JS.
In your terminal, run
npm install @ageesea/micro-form
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"
]
}
- Add more helper functions for html such as:
- validation
- etc.