Fieldset and Legend
フィールドセットとレジェンド
`<fieldset>` と `<legend>` は、関連するフォームコントロールのグループのための組み込みHTML要素です。legendはそれらが共有する質問を示します。
もう一つの例
税務フォームでは、「Filing status」(申告状況)の下に3つのラジオボタンがあります。それぞれの選択肢には独自のラベルがあります。エラーがある場合は、どの質問を修正すべきか分かるように、凡例の後に表示されます。
主な部分
- 01フィールドセット境界
- 02凡例の質問
- 03ラベル付きコントロール
以下の場合に使用します
ラジオボタン、チェックボックス、または1つの共有された質問に答えるフィールドに使用してください。
以下の場合は使用しないでください
ボックスをスタイルするためだけに `<fieldset>` を使用しないでください。内部のすべてのコントロールには独自のラベルが必要です。
コードで使用する名前
fieldset > legend + individually labeled controls 出荷前に
Give each field a label that code can read. Link hints and errors, and keep entered values. Check autofill, keyboard order, validation timing, submit states, failure recovery, zoom, and languages.
Outcome:Complete the task with フィールドセットとレジェンド (Fieldset and Legend)。 User context:税務フォームでは、「Filing status」(申告状況)の下に3つのラジオボタンがあります。それぞれの選択肢には独自のラベルがあります。エラーがある場合は、どの質問を修正すべきか分かるように、凡例の後に表示されます。 Recommended pattern:フィールドセットとレジェンド (Fieldset and Legend)。 Why it fits:ラジオボタン、チェックボックス、または1つの共有された質問に答えるフィールドに使用してください。 Do not use it when:ボックスをスタイルするためだけに `<fieldset>` を使用しないでください。内部のすべてのコントロールには独自のラベルが必要です。 Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary):この標準は、列挙された範囲のみを対象とします。視覚スタイル、製品の判断、またはVibularyの例は選びません。 Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
このリクエストを確認する
Review how フィールドセットとレジェンド (Fieldset and Legend) is used now. Definition: `<fieldset>` と `<legend>` は、関連するフォームコントロールのグループのための組み込みHTML要素です。legendはそれらが共有する質問を示します。 Release checks: Give each field a label that code can read. Link hints and errors, and keep entered values. Check autofill, keyboard order, validation timing, submit states, failure recovery, zoom, and languages. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.