Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save piihuynh/a5fd477c401deb6ce75f84e52a4ba0a6 to your computer and use it in GitHub Desktop.
Save piihuynh/a5fd477c401deb6ce75f84e52a4ba0a6 to your computer and use it in GitHub Desktop.

Revisions

  1. @niksumeiko niksumeiko revised this gist Apr 19, 2019. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions disable-html-form-input-autocomplete-autofill.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,4 @@
    ...
    ````

    This formation is going to prevent Chrome and Firefox to offer autofill and autocomplete for all input fields inside the form.

    ![Disable HTML form input autocomplete and autofill](http://s21.postimg.org/s9jaut5cn/1455907239797.jpg)
    This formation is going to prevent Chrome and Firefox to offer autofill and autocomplete for all input fields inside the form.
  2. @niksumeiko niksumeiko created this gist Feb 19, 2016.
    14 changes: 14 additions & 0 deletions disable-html-form-input-autocomplete-autofill.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # Disable HTML Form Input Autocomplete and Autofill

    1. Add `autocomplete="off"` onto `<form>` element;
    2. Add hidden `<input>` with `autocomplete="false"` as a first children element of the form.

    ````html
    <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.

    ![Disable HTML form input autocomplete and autofill](http://s21.postimg.org/s9jaut5cn/1455907239797.jpg)