Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ValidityState docs #26431

Merged
merged 28 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c873204
Update ValidityState docs
teoli2003 Apr 26, 2023
07a687e
Test
teoli2003 Apr 26, 2023
98edd80
Rename part1
teoli2003 Apr 26, 2023
cd1e899
Rename part2
teoli2003 Apr 26, 2023
a3918fb
Fix flaw
teoli2003 Apr 26, 2023
f242896
Fix flaw
teoli2003 Apr 26, 2023
c0a4474
Merge branch 'main' into validitystate
queengooborg May 20, 2023
999d073
Merge branch 'main' into validitystate
teoli2003 Dec 20, 2023
0f85569
Update files/en-us/web/api/validitystate/valid/index.md
teoli2003 Dec 20, 2023
3e67113
Update files/en-us/web/api/validitystate/valid/index.md
teoli2003 Dec 20, 2023
cc50680
Update files/en-us/web/api/validitystate/valid/index.md
teoli2003 Dec 20, 2023
e44456c
Update files/en-us/web/api/validitystate/customerror/index.md
teoli2003 Dec 20, 2023
c14e74c
Update files/en-us/web/api/validitystate/customerror/index.md
teoli2003 Dec 20, 2023
0d49694
Merge branch 'validitystate' of github.com:teoli2003/content into val…
teoli2003 Dec 20, 2023
5ff1189
Add labels to input boxes
teoli2003 Dec 20, 2023
4db37a7
more
teoli2003 Dec 21, 2023
8eaf6fb
Merge branch 'main' into validitystate
estelle Mar 21, 2024
91f5e03
Merge branch 'main' into validitystate
bsmth Apr 10, 2024
861a2c3
Merge branch 'main' into validitystate
bsmth May 6, 2024
efcae61
Merge branch 'main' into validitystate
bsmth Jun 21, 2024
1c437ba
Merge branch 'main' into validitystate
bsmth Jul 2, 2024
94ee941
feat(api): reportValidity and setCustomValidity example
bsmth Jul 15, 2024
96a188a
feat(api): reportValidity and setCustomValidity example
bsmth Jul 15, 2024
79640e9
feat(api): reportValidity and setCustomValidity example
bsmth Jul 15, 2024
bdcd3f5
feat(api): reportValidity and setCustomValidity example
bsmth Jul 15, 2024
974d242
Merge branch 'main' into validitystate
bsmth Jul 15, 2024
19aa740
feat(api): reportValidity and setCustomValidity example
bsmth Jul 15, 2024
315c81d
feat(api): ValidityState examples
bsmth Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/en-us/web/api/validitystate/customerror/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser-compat: api.ValidityState.customError

{{APIRef("HTML DOM")}}

The read-only **`customError`** property of the [`ValidityState`](/en-US/docs/Web/API/ValidityState) interface if the element's custom validity message has been set to a non-empty string by calling the element's {{domxref("HTMLObjectElement.setCustomValidity", "setCustomValidity()")}} method.
The read-only **`customError`** property of the [`ValidityState`](/en-US/docs/Web/API/ValidityState) interface returns `true` if an element doesn't meet the validation required in the custom validity set by the element's {{domxref("HTMLObjectElement.setCustomValidity", "setCustomValidity()")}} method.

## Value

Expand Down Expand Up @@ -46,7 +46,7 @@ confirmElement.addEventListener("change", () => {
confirmElement.setCustomValidity(
confirmElement.value != originalElement.value
? "Both email addresses must match."
: ""
: "",
);
});

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/validitystate/valid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ browser-compat: api.ValidityState.valid

{{APIRef("HTML DOM")}}

The read-only **`valid`** property of the [`ValidityState`](/en-US/docs/Web/API/ValidityState) interface indicates if the value of an {{HTMLElement("input")}}, after having been edited by the user, conforms to all the constraints set on the element.
The read-only **`valid`** property of the [`ValidityState`](/en-US/docs/Web/API/ValidityState) interface indicates if the value of an {{HTMLElement("input")}} element meets all its validation constraints, and is therefore considered to be valid.

If true, the element matches the {{cssxref(":valid")}} CSS pseudo-class; the {{cssxref(":invalid")}} CSS pseudo-class otherwise.
If `true`, the element matches the {{cssxref(":valid")}} CSS pseudo-class; otherwise the {{cssxref(":invalid")}} CSS pseudo-class applies.

## Value

Expand All @@ -27,7 +27,7 @@ const input = document.getElementById("age");
if (input.validity.valid) {
console.log("Bad input detected…");
} else {
console.log("Content of input OK.");
console.log("Input OK…");
}
```

Expand Down