0.0.8 • Published 10 years ago

form-utils v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

form-utils

Collection of essential Form helpers for the front-end.

Installation

npm install form-utils --save

# or

bower install form-utils --save

Examples

Obtain form data via form's id
// `obj` will be an object whose properties' names match each field's name in the form,
// each property value will be the value of each field.
var obj = FormUtils.obtainData('theFormId');
Obtain form data via form element
var form = document.getElementById('theFormId', false);
var obj = FormUtils.obtainData(form);
Set form data via form's id
// `obj` must be an object whose properties names match fields' names in the form,
//  whose values will be assigned to the values of the fields.
FormUtils.obtainData('theFormId', obj);
Disable form fields via form's id
FormUtils.enable('theFormId', false);
Disable form fields via form element
var form = document.getElementById('theFormId', false);
FormUtils.enable('theFormId', false);
Enable form fields via form's id
FormUtils.enable('theFormId', true);
0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago