1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Disable Auto-Completion For A Form Input as an html til

This commit is contained in:
jbranchaud
2020-08-06 09:15:51 -05:00
parent d76674e5b1
commit 21059b4b31
2 changed files with 20 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
_941 TILs and counting..._
_942 TILs and counting..._
---
@@ -283,6 +283,7 @@ _941 TILs and counting..._
### HTML
- [Adding Alt Text To An Image](html/adding-alt-text-to-an-image.md)
- [Disable Auto-Completion For A Form Input](html/disable-auto-completion-for-a-form-input.md)
- [Render Text As Superscript](html/render-text-as-superscript.md)
- [Submit A Form With A Button Outside The Form](html/submit-a-form-with-a-button-outside-the-form.md)

View File

@@ -0,0 +1,18 @@
# Disable Auto-Completion For A Form Input
The browser wants to be helpful by making informed suggestions about what
should be auto-filled into form inputs.
We may not want this behavior. It could be a source of data entry mistakes, an
annoyance, or just not something we want our users to experience.
We can turn this off at an individual field level with the `autocomplete`
attribute:
```html
<input type="email" id="email" name="email" autocomplete="off">
```
Note: It is `off` and not something like `false`.
[source](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion)