Skip to content

Commit 1b42afd

Browse files
committed
docs: replace content with accessibility concerns section
Signed-off-by: Christine <[email protected]>
1 parent 581cd09 commit 1b42afd

File tree

1 file changed

+31
-1
lines changed
  • files/en-us/web/html/reference/attributes/autocomplete

1 file changed

+31
-1
lines changed

files/en-us/web/html/reference/attributes/autocomplete/index.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,36 @@ The source of the suggested values is generally up to the browser; typically val
6969
> [!NOTE]
7070
> The `autocomplete` attribute also controls whether Firefox will — unlike other browsers — [persist the dynamic disabled state and (if applicable) dynamic checkedness](https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing) of an `<input>` element, `<textarea>` element, or entire `<form>` across page loads. The persistence feature is enabled by default. Setting the value of the `autocomplete` attribute to `off` disables this feature. This works even when the `autocomplete` attribute would normally not apply by virtue of its `type`. See [Firefox bug 654072](https://bugzil.la/654072).
7171
72+
## Accessibility Concerns
73+
74+
If a form does not have `autocomplete="off"`, the browser will still attempt to autocomplete the form fields, which can make it difficult for screen readers and other assistive technologies to navigate the form, potentially causing these users to be unable to complete the form. the lack of autocomplete or autocomplete=off and so on is something that automated accessibility tests would reliably catch and flag. This affects the usability of a form specifically but also the accessibility compliance of the website as a whole.
75+
76+
## Example
77+
78+
### HTML
79+
80+
```html
81+
<form>
82+
<label for="username">Username:</label>
83+
<input
84+
type="text"
85+
id="username"
86+
name="username"
87+
autocomplete="on"
88+
aria-required="true"
89+
aria-label="Enter your username" />
90+
<label for="password">Password:</label>
91+
<input
92+
type="password"
93+
id="password"
94+
name="password"
95+
autocomplete="on"
96+
aria-required="true"
97+
aria-label="Enter your password" />
98+
<input type="submit" value="Submit" />
99+
</form>
100+
```
101+
72102
## Values
73103

74104
The attribute value is either the keyword `off` or `on`, or a space-separated `<token-list>` that describes the meaning of the autocompletion value.
@@ -78,7 +108,7 @@ The attribute value is either the keyword `off` or `on`, or a space-separated `<
78108
- : The browser is not permitted to automatically enter or select a value for this field. It is possible that the document or application provides its own autocomplete feature, or that security concerns require that the field's value not be automatically entered.
79109

80110
> [!NOTE]
81-
> In most modern browsers, setting `autocomplete` to `"off"` will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form. See [Managing autofill for login fields](/en-US/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion#managing_autofill_for_login_fields). Also, if a form does not have `autocomplete="off"`, the browser will still attempt to autocomplete the form fields, which can make it difficult for screen readers and other assistive technologies to navigate the form, potentially causing these users to be unable to complete the form.
111+
> In most modern browsers, setting `autocomplete` to `"off"` will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form. See [Managing autofill for login fields](/en-US/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion#managing_autofill_for_login_fields).
82112
83113
- `on`
84114

0 commit comments

Comments
 (0)