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

Suggest to allow "autocomplete" on input type=checkbox|radio #1894

Open
SpyroTEQ opened this issue Oct 13, 2016 · 1 comment
Open

Suggest to allow "autocomplete" on input type=checkbox|radio #1894

SpyroTEQ opened this issue Oct 13, 2016 · 1 comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms

Comments

@SpyroTEQ
Copy link

Hi,

often on the web, we need to remember a user's preference like whether something was expanded or collapsed, or the current selected "in-page" tab (like "Write/Preview" when filling a github issue), or whether a disclaimer was closed/left open...

We can achieve such behavior with an input checkbox or radio, and style through CSS. But to remember the input's last status (whether it was checked or not), we need javascript or server-side storage.

Suggestion
Allowing the autocomplete attribute on the input of type checkbox and radio would then help a lot. In such case, if autocomplete="on" is set on an input, then the confirming UA will have to remember whether the input was checked (for checkbox) and which value was checked (for radio) or if none was (for radio). Such autocomplete would probably wear the "autofill expectation mantle" (on/off only).

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms labels Oct 13, 2016
@NVolcz
Copy link

NVolcz commented Oct 3, 2022

Firefox already implements this but other browsers doesn't seem to which causes some confusion on the web: https://stackoverflow.com/questions/299811/why-does-the-checkbox-stay-checked-when-reloading-the-page
Someone asking Firefox to stop this: https://bugzilla.mozilla.org/show_bug.cgi?id=1752290

I find it quite strange that autocomplete is not allowed on checkboxes. Users must find it strange that the fields are autocompleted but not checkboxes when reloading a page.

NicolasCARPi added a commit to elabftw/elabftw that referenced this issue Mar 12, 2024
While not a valid attribute for checkbox, the `autocomplete=off` attribute is necessary in firefox, or the browser will "remember" the state instead of displaying the correct html defined state. So it's best to keep it, as other browsers will simply ignore it.

For reference: whatwg/html#1894
https://bugzilla.mozilla.org/show_bug.cgi?id=1752290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms
Development

No branches or pull requests

3 participants