1.2.3 • Published 6 years ago
formcreator-dynamic v1.2.3
DynamicFormGen
How to Use
Require and Build the JSON
- Require the util file
const FormGen = require('formcreator-dynamic');
- Sample object to create the form
FormGen.generate(
{
tags: [
{
tag: 'label',
value: 'Name',
for: 'name',
},
{
tag: 'input',
type: 'text',
},
{
tag: 'select',
options: ['THis', 'Is', 'a', 'valuE'],
},
],
settings: {
action: '/save-item',
method: 'POST',
},
})
Acceptable tags
- input
- select
- label