AdvancedCustomFields / AdvancedCustomFields/acf

Incorrect use of <label for=FORM_ELEMENT>

Open
#958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Chrome DevTools indicates, that some ACF fields has issue, that generated field HTML has label with for attribute, that has no related element with same id, for example:

  • Checkbox
  • File Input
  • Tabs

To Reproduce
Steps to reproduce the behavior:

  1. Create ACF fields group with type checkbox.
  2. Go to post edit page.
  3. Open DevTools Issues tab (if not shown click red icon with number on top right corner on the left of Settings icon).
  4. See error

Expected behavior

  • Attribute for must be removed when is not applicable.
  • Attribute for must have id target to File input.

Screenshots or Video
Image

Version Information:

  • WordPress Version 6.8.1
  • PHP Version 8.3.6
  • ACF Version ACF PRO 6.4.0.1
  • Browser Chrome 135

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the post edit page with Checkbox, File Input, and Tabs fields, then inspect their generated HTML and Chrome DevTools Issues tab. Update the affected markup so labels either omit an inapplicable for attribute or target an existing file-input id; done means the reported label errors no longer appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
accessibility
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.