Duplicate 'edit-submit' ID attributes on the page

Created on 20 July 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

Problem/Motivation

The Google search form uses generic Drupal edit-submit ID attributes, which could conflict with any/all other Drupal forms on the page.

Though Drupal is supposed to be smart enough to append numbers to IDs when multiple forms with the same IDs are on the page, we have found this to be unreliable on modern Drupal sites, due to the multiple individual caches for many elements making up a single page.

The duplicate ID attributes cause sites to fail accessibility checks, so until the cache/ID problem is resolved in core, we can avoid the problem by not using the generic Drupal attributes on form elements.

Proposed resolution

If the Google CSE form used unique identifiers for the search element and submit button, it would make it less likely to cause conflicts.

Remaining tasks

Add ID attributes to form elements.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jenlampton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024