xbogdan / overlay-form

Creates an overlay containing a form with your wanted fields.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overlay Form

Creates an overlay containing a form with your wanted fields.

Usage

var overlayForm = new of({
  fields: [
    {
      label: 'Name',
      inputType: 'text',
      inputName: 'name-field',
      value: 'John'
    },
    {
      label: 'Password',
      inputType: 'password',
      inputName: 'password-field'
    }
  ],
  finishCallback: function(data) {
    console.log(data);
  }
});

# Fields `inputName` field is optional. If it is not set the name of the input is ```javascript label.split(' ').join('-').toLowerCase(); ```
`data` argument of the `finishCallback` function is an `array` of js objects where
`name` is the `inputName` field ```javascript { name: 'name-field', value: 'John' } ```
`value` field is optional

About

Creates an overlay containing a form with your wanted fields.

License:MIT License


Languages

Language:JavaScript 66.5%Language:CSS 33.5%