Skip to content

Conversation

estelle
Copy link
Member

@estelle estelle commented Aug 22, 2025

Added details about the elements included in the HTMLFormControlsCollection.

The elements IDL attribute must return an HTMLFormControlsCollection rooted at the form element's root, whose filter matches listed elements whose form owner is the form element, with the exception of input elements whose type attribute is in the Image Button state, which must, for historical reasons, be excluded from this particular collection.

related to #40760

Added details about the elements included in the HTMLFormControlsCollection.
@estelle estelle requested a review from a team as a code owner August 22, 2025 10:01
@estelle estelle requested review from wbamberg and removed request for a team August 22, 2025 10:01
@github-actions github-actions bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Aug 22, 2025
Copy link
Contributor

github-actions bot commented Aug 22, 2025

Preview URLs

(comment last updated: 2025-08-22 10:25:33)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@@ -9,6 +9,8 @@ browser-compat: api.HTMLFormControlsCollection

The **`HTMLFormControlsCollection`** interface represents a _collection_ of HTML _form control elements_, returned by the {{domxref("HTMLFormElement")}} interface's {{domxref("HTMLFormElement.elements", "elements")}} property.

The collection of form control elements includes {{htmlelement("button")}}, {{htmlelement("fieldset")}}, {{htmlelement("input")}}, {{htmlelement("object")}}, {{htmlelement("output")}}, {{htmlelement("select")}}, and {{htmlelement("textarea")}} elements whose form owner is the {{htmlelement("form")}} element.
Copy link
Member

Choose a reason for hiding this comment

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

Personally I think this should be documented in elements (which we already do). HTMLFormControlsCollection is just a collection, and what's put inside this collection is up to each property that returns it, of which there happens to be only one, but this still feels out of place.

Copy link
Member Author

Choose a reason for hiding this comment

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

there are form controls that are not sent to the server that are included, so the list is an odd one, which is why i included it. It should be included on this page b/c of that, but perhaps in a different way. Do you have a suggestion?

For example,

  1. fieldset is not sent to the server, but is in the collection.
  2. If a control is nested in a form, but has a form attribute that dissociates it from its ancestor form, it is not included.
  3. If a fieldset is not in the form, but has a form attribute that associates it, it is included, but not sent. It's descendant form controls are only included and sent if they too have the form attribute.

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/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants