validity
MMO.core · 5 symboles · générée le 27 Oct 2026
validity
validity.js:13The messages of the browser's own checks (required, min, max, pattern...) speak the browser's language, not the application's ("Value must be 10/19/2026 03:08 PM or earlier." in a French page), and a date bound comes in the browser's format. These say the same in the page's language, the bounds of a date in its own format.
- Espace de noms
MMO.core- Voir
mmo-validity, which shows them under its controls
Constantes1
DATE_TYPES
validity.js:15the input types whose bounds are dates, and how a bound of each is written
isMissing
validity.js:25Whether a control's value is none, for required (valueMissing): no value, an empty text, an empty list. What a custom element that holds any value checks (<mmo-select>): the empty text of a search is no choice (#264).
- Espace de noms
MMO.core.validity
| value | * | |
| retourne | boolean | false for 0 and false, which are values |
formatBound
validity.js:40Write a bound (min, max) of a control for the user: a date in the page's format, a number grouped.
- Espace de noms
MMO.core.validity
| value | string | the attribute's value ('2026-10-16', '2026-10-16T15:08', '15:08', '12') |
| type | string | the input's type |
| lang = null | ?string | the locale, the page's by default |
| retourne | string | the value itself when it cannot be read |
message
validity.js:71The message of the first check a control fails, in the page's language.
- Espace de noms
MMO.core.validity
| element | Element | an input, a select, a textarea, or anything with validity and validationMessage |
| lang = null | ?string | the locale, the page's by default |
| retourne | string | an empty string when the control is valid |
compareBounds
validity.js:147Compare two bounds of the same control.
- Espace de noms
MMO.core.validity
| a | string | |
| b | string | |
| type | string | the input's type |
| retourne | number | -1, 0 or 1; 0 when either cannot be read |