Add autocomplete attributes to name fields

Created on 6 September 2022, over 2 years ago
Updated 2 April 2025, about 1 month ago

Problem/Motivation

When a user has saved a name in their browser (e.g. Chrome), and they fill out a form with a name field, autocomplete may treat each name field as a "full name" field, causing users to enter their full name multiple times: e.g. in both the given and family name fields.

Steps to reproduce

Add a name field to a content type. Set the name field to use the given (first) and family (last) components.
Using a browser in which you have saved name information, fill out the form. See that it suggests your full name in both fields.

Proposed resolution

1. Add a new "Autocomplete Hints" instance setting for each name field, with three options: "None" (default), "Add autocomplete hints", "Disable autocomplete".

2. If hinting/disable has been checked for that field, then add the relevant autocomplete attributes from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplet... to each of the rendered components.

Remaining tasks

Create patch.

User interface changes

Yet one more option in the field configuration form.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States gbirch

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.

Production build 0.71.5 2024