Skip to content

[FEATURE] autocomplete attributes for forms and fields #1233

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

Open
wants to merge 5 commits into
base: typo3-v12
Choose a base branch
from

Conversation

thomasrawiel
Copy link

@thomasrawiel thomasrawiel commented May 10, 2025

Added autocomplete options for forms and input and textarea fields.

Forms:
Autocomplete token: on/off
<form ... autocomplete="on">

Fields:

  • Autocomplete token: on/off/Several options
  • Section (optional)
  • Type (optional)
  • Purpose (optional)
    Section, Type and Purpose are conditionally displayed, depending on the token value

Added a viewhelper that creates the autocomplete token string for fields, which is by section, purpose, type, token
e.g.
<input ... autocomplete="on">
<input ... autocomplete="billing email">
<input ... autocomplete="billing work email">
<input ... autocomplete="section-foo billing home email">
The viewhelper applys rules (as I understand them) from the specs, regarding what is allowed for which field, token type etc. For example select fields allow everything an input allows, but most tokens are not meaningful for select fields and will be ignored by browsers. If a tolen is deemed not meaningful/ allowed for a certain field, the token just won't be rendered (no error message)

Raised required TYPO3 version to 12.4.18 to allow arbitrary arguments in form viewhelper, see thomasrawiel/powermailautocomplete#7

Code adapted from EXT:powermailautocomplete whch has been tested in TYPO3 12 and 13.

Source: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field

Resolves #789
There has been a previous pull request on this topic but I think this one is "more correct" in my opinion

@thomasrawiel thomasrawiel changed the title Feat autocomplete [FEATURE] autocomplete attributes for forms and fields May 10, 2025
@thomasrawiel thomasrawiel force-pushed the feat-autocomplete branch 3 times, most recently from 9e77256 to 8d689d5 Compare May 10, 2025 19:51
@kftw
Copy link

kftw commented May 28, 2025

Hi! It's really nice to see this feature integrated into powermail. Do you have an idea when this will be merged into the V12 branch?

@lingnercom
Copy link

@kftw If you can live with this you can install EXT:powermailautocomplete until this feature is added to the powermail core

@kftw
Copy link

kftw commented May 28, 2025

@kftw If you can live with this you can install EXT:powermailautocomplete until this feature is added to the powermail core

Thanks for the hint!

@baschny
Copy link

baschny commented Jun 4, 2025

Great feature! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Autocomplete attribute missing
4 participants