fromform
v0.1.1
Published
Create form from object, change object from form.
Downloads
1
Readme
fromform
Create form from object, change object from form.
Usage
const fromform = require('fromform');
const data = {
name: {
_type: 'text',
_value: 'Bob'
},
gender: {
_type: 'select',
_options: [
'male', 'female'
]
},
weight: {
number: {
_type: 'number'
},
unit: {
_type: 'select',
_options: [
'kilogram', 'pound'
]
}
},
favouriteColor: {
_type: 'color',
_value: '#000'
}
};
let f = fromform(obj); // return a DocumentFragment instance
document.getElementById('form-container').appendChild(f);
License
Copyright (c) 2017-present, shenfe