0.1.5 • Published 6 years ago

jwformbuilder v0.1.5

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

jwFormBuilder

NPM Module to build form

Made with TDD.

Installation

Just use npm: npm install --save jwFormBuilder

Usage

const jwformbuilder = require("jwformbuilder");

buildForm

Takes an array of fields and options. Returns an HTML form that contains those requested inputs.

const fieldJson = [
  {type: 'text', id: 'textInput1', name: 'textInput1', placeholder: 'Enter text here'},
  {type: 'select', id: 'selectTest', name: 'selectTest'},
  {type: 'password', id: 'userPassword', name: 'userPassword', placeholder: 'Enter password'},
  {type: 'email', id: 'userEmail', name: 'userEmail', placeholder: 'Enter email'},
  {type: 'textarea', id: 'textarea', name: 'textarea', placeholder: 'Write a message here'}
];

let formHtml = jwformbuilder.createForm(fieldJson);
// use the html as you desire
console.log('HTML for this form: ', formHtml);
0.1.5

6 years ago

0.1.4

6 years ago

0.1.1

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago