-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Enhance HTMLFormControlsCollection description #40841
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
base: main
Are you sure you want to change the base?
Conversation
Added details about the elements included in the HTMLFormControlsCollection.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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,
- fieldset is not sent to the server, but is in the collection.
- If a control is nested in a form, but has a
form
attribute that dissociates it from its ancestor form, it is not included. - 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 theform
attribute.
Added details about the elements included in the HTMLFormControlsCollection.
related to #40760