Skip to content

Name of <fieldset> group given by <legend> and <fieldset name=""> confusable #3702

Closed

Description

@fantasai

In https://html.spec.whatwg.org/multipage/form-elements.html#the-fieldset-element

The name of the group is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.

I wasn't able to find another use of “name” in the sense that it is defined here, that is, I couldn't find any reference to how such a name would be used.

The term seems to be causing some confusion in w3c/csswg-drafts#1584 so this is a request for some clarification, and/or perhaps calling it the “legend or label”of the group (or “caption”, to be consistent with how <label> is defined) so it's at least clearly not the same as the name of the <fieldset> element.

The name attribute represents the element's name.

Activity

  1. domenic commented on May 23, 2018

    @domenic
    Member

    This makes sense. I'm thinking rewriting the two paragraphs there to something like

    The fieldset element represents a set of form controls grouped together, optionally with a caption. The caption is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.

  2. added
    clarification
    good first issue
    topic: forms
    on May 23, 2018
  3. fantasai commented on May 23, 2018

    @fantasai
    ContributorAuthor

    That looks great! My main concern is with “The remainder of the descendants form the group.” ... It's a group of form controls, but the contents of the <fieldset> can include all manner of other expository content, so this sentence somehow needs to encapsulate that content as well as the controls themselves.

  4. LJWatson commented on May 23, 2018

    @LJWatson

    I don't think it's the intent of "name" in this context, but worth mentioning that the <legend> gives the <fieldset> its accessible name.

  5. Loirooriol commented on May 23, 2018

    @Loirooriol
    Contributor

    I think a note saying that this is not the same as the rendered legend would be useful.

  6. removed
    good first issue
    on May 23, 2018
  7. zcorpan commented on Aug 15, 2018

    @zcorpan
    Member

    OK so how about this

    The fieldset element represents a set of form controls (or other content) grouped together, optionally with a caption. The caption is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.

    I'm not convinced it's useful to point to a term in the rendering section, it seems to me it could rather make things more confusing.

  8. added a commit that references this issue on Aug 21, 2018
    9d05ff4
  9. added a commit that references this issue on Aug 21, 2018
    1694139
  10. added 2 commits that reference this issue on Feb 15, 2019
    5b96dea
    a1637ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationtopic: forms

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions