Formalizer

Formalizer

new Formalizer()

Main Formalizer class constructor

Methods

(private, static) _activeGrp()

Set the current group to display

(private, static) _chckRowCom(row, name, fields)

ROW INPUT Check the row component type, this will then delegate to the correct method for creating the row element

Parameters:
Name Type Description
row HTMLElement

The row element reference

name String

The row name reference

fields Object

The fields object for the group

(private, static) _checkEmail(name, value, result, custErr)

Determines if a given string is empty

Parameters:
Name Type Description
name String

The name of the field

value String

The field input value

result Array

Result array

custErr String

The custom error message for the field validation

(private, static) _checkEmpty(name, value, result, custErr)

Determines if a given string is empty

Parameters:
Name Type Description
name String

The name of the field

value String

The field input value

result Array

Result array

custErr String

The custom error message for the field validation

(private, static) _checkMatch(name, value, result, custErr)

Determines if 2 values match, specifically for password confirmation type fields

Parameters:
Name Type Description
name String

The name of the field

value String

The field input value

result Array

Result array

custErr String

The custom error message for the field validation

(private, static) _checkMaxMin(name, value, max, min, result, custErr)

Determines if a given value is greater than max or less than min

Parameters:
Name Type Description
name String

The name of the field

value String

The field input value

max Number

Max value

min Number

Min value

result Array

Result array

custErr String

The custom error message for the field validation

(private, static) _checkNotify(values)

Check if there are any notifications set and dispatch

Parameters:
Name Type Description
values Object

The user inputs data object

(private, static) _checkValues()

VALIDATE Initialize the validation for the form fields, this will determine if EMPTY values are permitted, which by default they are not in validation this should also check for maximum and minimum values

(private, static) _clearWarnings()

REMOVE WARNING - Remove the warning elements that were added to the do

(private, static) _crteButs()

Create a form element based on the element type

(private, static) _crteChckbxEl(row, opts, name)

Create a group of checkbox elements based on the options

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteChckGrdOpts(row, opts, values, name)

Create the options for the checkbox grid

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

values Object

The values to populate the options with

name String

The row name reference

(private, static) _crteChckGrid(row, opts, name)

Create a group of checkbox elements based on the options

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteCheckGrp(row, opts, values, name)

Create a group of checkbox elements based on the options

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

values Array

An array of values for the checkbox

name String

The row name reference

(private, static) _crteDateSelCom(row, opts, name)

This will generate 3 SELECT element for the Day/Month/Year

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteFileCom(row, opts, name)

Creates the password component which is a component that has 2 password fields form confirnmation and an optional strength check analysis

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteGrd(parent, name, attributes, data)

Create a list grid that users can select item from, the first row has a checkbox to allow for selection

Parameters:
Name Type Description
parent HTMLElement

The row or component container to append the element to

name String

The name reference of the element

attributes Object

The attributes for the element

data Object

The data object for the row

(private, static) _crteGrpEl(grp, fields)

CREATE GROUP ELEMENTS Create the group elements, the elements that should be present in one group

Parameters:
Name Type Description
grp HTMLElement

The group element reference

fields Object

The fields object for the group

(private, static) _crteInputEl(row, opts, name)

Create a new input element, this will configure the creation of standard input type element such as the "text" "password" "radio" "checkbox"

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crtePwordCom(row, opts, name)

Creates the password component which is a component that has 2 password fields form confirnmation and an optional strength check analysis

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteRadioGrp(row, opts, name)

Create a group of radio elements based on the options

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteRowEl(grp, name, fields)

CREATE ROW Create a new form row which has the default left and right element to control positioning of the form row elements and labels

Parameters:
Name Type Description
grp HTMLElement

The group element reference

name String

The row name reference

fields Object

The fields object for the group

(private, static) _crteSelectDateOpts(row, opts, name)

Parameters:
Name Type Description
row HTMLElement

The row element reference

opts Object

The options for the element

name String

The row name reference

(private, static) _crteSelectEl(row, opts, name)