From 4f1ba6d2c029e2f1026766f755ffffe0a6ed972a Mon Sep 17 00:00:00 2001 From: Roma Zvarich Date: Sun, 18 Jul 2021 14:18:00 +0300 Subject: Перевод "Validitystate" и дочерних статей (#1531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 'ValidityState' topic * 'badInput' topic * 'patternMismatch' topic * 'range overflow' article * 'range underflow' article * 'step mismatch' article * 'Too long' article * 'Too short' article * 'Type mismatch' article * 'Read only' fix * Typo fix * Update files/ru/web/api/validitystate/badinput/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/badinput/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/stepmismatch/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/toolong/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/typemismatch/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/typemismatch/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> * Update files/ru/web/api/validitystate/typemismatch/index.html Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> Co-authored-by: Maxim Postautov <54762420+mpstv@users.noreply.github.com> --- .../web/api/validitystate/stepmismatch/index.html | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 files/ru/web/api/validitystate/stepmismatch/index.html (limited to 'files/ru/web/api/validitystate/stepmismatch') diff --git a/files/ru/web/api/validitystate/stepmismatch/index.html b/files/ru/web/api/validitystate/stepmismatch/index.html new file mode 100644 index 0000000000..3a29e316b5 --- /dev/null +++ b/files/ru/web/api/validitystate/stepmismatch/index.html @@ -0,0 +1,38 @@ +--- +title: ValidityState.stepMismatch +slug: Web/API/ValidityState/stepMismatch +tags: + - API + - Constraint Validation API + - DOM + - Свойство + - Справочник +browser-compat: api.ValidityState.stepMismatch +--- +

Доступное только для чтения свойство stepMismatch объекта ValidityState указывает, соответствует ли значение {{HTMLElement("input")}} после изменения пользователем ограничениям, установленным атрибутом step.

+ +

Если поле является числовым, включая типы {{HTMLElement("input/date", "date")}}, {{HTMLElement("input/month", "month")}}, {{HTMLElement("input/week", "week")}}, {{HTMLElement("input/time", "time")}}, {{HTMLElement("input/datetime-local", "datetime-local")}}, {{HTMLElement("input/number", "number")}}, {{HTMLElement("input/range", "range")}} и значение атрибута step не равно any, в случае не соответствия поля ограниченям атрибутов step и min, то stepMismatch будет true. Если остаток от деления значения элемента формы за вычетом min на step, (которое по умолчаиню равно 1) не равен нулю, то это является несоответствием.

+ +

Учитывая следующее:

+ +
<input type="number" min="20" max="40" step="2"/>
+ +

если (value - min) % 2 != 0, stepMismatch будет true.

+ +

Если true, элемент соответствует CSS-псевдоклассам {{cssxref(":invalid")}} и {{cssxref(":out-of-range")}}.

+ +

Спецификации

+ +{{Specifications}} + +

Совместимость с браузерами

+ +

{{Compat}}

+ +

Смотрите также

+ + -- cgit v1.2.3-54-g00ecf