Class: FormsHolder

FormsHolder

This class holds separate Form instances on one page.

Constructor

new FormsHolder()

Create FormsHolder.
Source:

Methods

addForm(form) → {boolean}

Loggs a form to the internal array.
Parameters:
Name Type Description
form Form A Form to be logged in an internal structure.
Source:
Returns:
- Return true if registering the Form was successful or false if it was already registered prior to this attempt.
Type
boolean

createForm(data) → {Form}

Creates a new Form object based on passed data.
Parameters:
Name Type Description
data Object An object defining the properties of a Form.
Source:
See:
  • Form for more information on the Object structure.
Returns:
- The new Form object created.
Type
Form

formIndex(form) → {number}

Checks for the Form index in the internal structure.
Parameters:
Name Type Description
form Form A Form to be found in the internal structure.
Source:
Returns:
- Form index position, -1 means it is not present and numbers greater or equal 0 means the form is already present
Type
number

isAlreadyLogged(form) → {bool}

Determines whether the form is already logged or not
Parameters:
Name Type Description
form Form A Form to be found in the internal structure.
Source:
Returns:
- If true the Form is registered in the structure. If false it is not.
Type
bool

removeForm(form) → {boolean}

Removes a form from the internal array.
Parameters:
Name Type Description
form Form A Form to be removed from the internal structure.
Source:
Returns:
- Return true if unregistering the Form was successful or false if it was already unregistered prior to this attempt.
Type
boolean