Skip to content
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

Send Message A11Y Audit - Unique IDs #2125

Open
4 tasks
jonathanbobel opened this issue Nov 18, 2024 · 0 comments · May be fixed by #2206
Open
4 tasks

Send Message A11Y Audit - Unique IDs #2125

jonathanbobel opened this issue Nov 18, 2024 · 0 comments · May be fixed by #2206
Assignees

Comments

@jonathanbobel
Copy link
Contributor

Issue: Ensure Form Elements Have Unique IDs

Problem:
Some form elements in the Send Message flow use non-unique IDs such as placeholder_value. According to accessibility standards and best practices, each element must have a unique ID. Duplicate IDs can lead to:

  1. Accessibility issues for users relying on assistive technologies, as screen readers cannot correctly associate labels or error messages with specific elements.
  2. JavaScript errors or unpredictable behavior when manipulating elements by ID.
  3. Parsing errors that violate the HTML specification and WCAG guidelines.

Relevant WCAG Success Criterion:


Steps to Reproduce:

  1. Open a form in the application.
  2. Inspect form elements using the browser developer tools.
  3. Observe that some elements share the same id attribute, such as placeholder_value.

Proposed Solution:

  1. Assign Unique IDs to All Form Elements:

    • Replace generic or duplicate IDs with unique, meaningful IDs. For example:
      <!-- Before -->
      <input id="placeholder_value" name="email">
      <input id="placeholder_value" name="username">
      
      <!-- After -->
      <input id="email" name="email">
      <input id="username" name="username">
  2. Update Related References:

    • Update any attributes that reference the IDs (e.g., for, aria-labelledby, aria-describedby) to match the new unique IDs.
  3. Generate IDs Dynamically (if applicable):

    • For programmatically generated forms, implement logic to generate unique IDs for each form element.

Acceptance Criteria:

  • All form elements have unique id attributes.
  • Related attributes (for, aria-labelledby, etc.) correctly reference the unique IDs.
  • Changes are tested with screen readers (e.g., VoiceOver, NVDA, JAWS) to ensure proper associations.
  • The updated markup passes HTML validation without errors.

References:


By addressing this issue, we ensure that the application meets accessibility standards and provides a better user experience for all users.

@jonathanbobel jonathanbobel converted this from a draft issue Nov 18, 2024
@jonathanbobel jonathanbobel changed the title Send Messages A11Y Audit - Unique IDs Send Message A11Y Audit - Unique IDs Nov 18, 2024
@heyitsmebev heyitsmebev self-assigned this Dec 10, 2024
@heyitsmebev heyitsmebev moved this from 🌱 New to 🏗 In progress (WIP: ≤ 3 per person) in Notify.gov product board Dec 10, 2024
@heyitsmebev heyitsmebev moved this from 🏗 In progress (WIP: ≤ 3 per person) to 👀 In review in Notify.gov product board Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
2 participants