# Global

##

### Methods

#### createState($input, value, isValid, validatorName, data, isLiveValidation)

  Create a basic state object that will be return as parameter in promises

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `$input` | HTMLElement |
  `value` | String | Number |
  `isValid` | Boolean |
  `validatorName` | String |
  `data` | * |
  `isLiveValidation` | Boolean |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Validator_State

#### getLabel($input [, $wrapper])

  Get the text of a label's input

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `$input` | HTMLElement |  |  |
  `$wrapper` | HTMLElement | <optional> | document.body |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Return the label, if there is only one, the list of labels if many or '' if none
  Type
    string | Array.<string>

#### getLabelElement($input [, $wrapper])

  Get the label of an input

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `$input` | HTMLElement |  |  |
  `$wrapper` | HTMLElement | <optional> | document.body |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Return the label, if there is only one, the list of labels if many or null if none
  Type
    HTMLElement | Array.<HTMLElement> | null

#### getQueryFromForm($form [, selector])

  Create a query with the fields of a form. Use a fallback for browser that doesn't support new URLSearchParams( formData ).toString()

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `$form` | HTMLElement |  |  |
  `selector` | String | <optional> | 'select,input,textarea' | Only used for browser with no native new URLSearchParams( formData ).toString()

  ##### Returns:

  Type
    String

#### getRadioList(inputRadioOrInputName, userOptions)

  Get all radio with the same name

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `inputRadioOrInputName` | HTMLElement | string |
  `userOptions` | Object | ###### Properties
  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `selector` | String | <optional> | input[name="{NAME}"] | css selector of the elements with a {GROUP_NAME} tag that will be replace by groupName var.
  `othersOnly` | Boolean | <optional> | false | if true, return the list without the element in `inputRadioOrInputName`. If `inputRadioOrInputName` is a string (input name), return all radio

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Return all elements
  Type
    Array.<HTMLElement>

#### isDate(value [, format])

  Test if the value is a date

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `value` | String |  |  |
  `format` | String | <optional> | "d/m/y" | d for day, m for month and y for year. Only in lowercase. January = 1

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Boolean

#### isEmail(value [, loose])

  Test if the value is an email

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `value` | String |  |
  `loose` | Boolean | <optional> |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Boolean

#### isEmpty(value)

  Test if there is a value

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `value` | String |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Boolean

#### isNumber(value)

  Test if the value is a number

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `value` | String |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Boolean

#### isRadioListChecked($iputRadioOrRadioList)

  Get the selected radio button from a list.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `$iputRadioOrRadioList` | Array.<HTMLElement> | HTMLElement |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Return the selected radio button from a group or false
  Type
    false | HTMLElement

#### isUrl(value)

  Test if the value is an url

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `value` | String |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Boolean

#### standardValidation($input, value, isValid, validatorName, data, isLiveValidation)

  Helper for basic (synchronous) validation system

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `$input` | HTMLElement |
  `value` | String |
  `isValid` | Boolean |
  `validatorName` | String |
  `data` | * |
  `isLiveValidation` | Boolean |

  See:
    - extra/modules/validator.md for details

  ##### Returns:

  Type
    Promise

### Type Definitions

#### Validator_State

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `$input` | HTMLElement |
  `value` | String | Number |
  `isValid` | Boolean |
  `validatorName` | String |
  `data` | * |

#### Search results