Skip to content

Instantly share code, notes, and snippets.

@robhi2031
Last active August 24, 2021 17:20
Show Gist options
  • Save robhi2031/c1e17911376bc4b391cb192cdd3c16f9 to your computer and use it in GitHub Desktop.
Save robhi2031/c1e17911376bc4b391cb192cdd3c16f9 to your computer and use it in GitHub Desktop.
Disable Autocomplete and Autofill On HTML Form Input

Disable Autocomplete and Autofill On HTML Form Input

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...

This formation is going to prevent Chrome and Firefox to offer autofill and autocomplete for all input fields inside the form. After everything I've done, this way is quite helpful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment