[FEATURE] autocomplete attributes for forms and fields #1233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added autocomplete options for forms and input and textarea fields.
Forms:
Autocomplete token: on/off
<form ... autocomplete="on">
Fields:
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#7Code 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