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

New pages: HTMLxElement.setCustomValidity() #35948

Merged
merged 2 commits into from
Sep 19, 2024
Merged

New pages: HTMLxElement.setCustomValidity() #35948

merged 2 commits into from
Sep 19, 2024

Conversation

estelle
Copy link
Member

@estelle estelle commented Sep 18, 2024

part of #35544

@estelle estelle requested a review from a team as a code owner September 18, 2024 23:57
@estelle estelle requested review from wbamberg and removed request for a team September 18, 2024 23:57
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Sep 18, 2024
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nits that should be applied to every page, otherwise this is good.

### Parameters

- `string`
- : The string containing the error message.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : The string containing the error message.
- : The string containing the error message. The empty string removes any custom validity errors.


{{ APIRef("HTML DOM") }}

The **`setCustomValidity()`** method of the {{DOMxRef("HTMLButtonElement")}} interface sets the custom validity message for the {{htmlelement("button")}} element to the specified message. Use the empty string to indicate that the element does _not_ have a custom validity error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The **`setCustomValidity()`** method of the {{DOMxRef("HTMLButtonElement")}} interface sets the custom validity message for the {{htmlelement("button")}} element to the specified message. Use the empty string to indicate that the element does _not_ have a custom validity error.
The **`setCustomValidity()`** method of the {{DOMxRef("HTMLButtonElement")}} interface sets the custom validity message for the {{htmlelement("button")}} element. Use the empty string to indicate that the element does _not_ have a custom validity error.


{{ APIRef("HTML DOM") }}

The **`setCustomValidity()`** method of the {{DOMxRef("HTMLFieldSetElement")}} interface sets the custom validity message for the {{htmlelement("fieldset")}} element to the specified message. Use the empty string to indicate that the element does _not_ have a custom validity error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that fieldset/output are not validation targets and therefore the message won't actually be displayed when calling reportValidity (but will be reported by the validity object)?

@Josh-Cena
Copy link
Member

Also, I suggest porting whatever template we used for these few pages to the existing setCustomValidity pages too.

@estelle estelle merged commit 26c4d54 into main Sep 19, 2024
9 checks passed
@estelle estelle deleted the scv branch September 19, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants