Skip to content

Instantly share code, notes, and snippets.

@manh-dan
Forked from runspired/form.html
Created August 17, 2021 02:13
Show Gist options
  • Select an option

  • Save manh-dan/d18d40c4a587936bc3556c32b9ad946a to your computer and use it in GitHub Desktop.

Select an option

Save manh-dan/d18d40c4a587936bc3556c32b9ad946a to your computer and use it in GitHub Desktop.

Revisions

  1. @runspired runspired created this gist May 23, 2016.
    22 changes: 22 additions & 0 deletions form.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!--
    <form autocomplete="off"> will turn off autocomplete for the form in most browsers
    except for username/email/password fields
    -->
    <form autocomplete="off">

    <!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
    <input id="username" style="display:none" type="text" name="fakeusernameremembered">
    <input id="password" style="display:none" type="password" name="fakepasswordremembered">

    <!--
    <input autocomplete="nope"> turns off autocomplete on many other browsers that don't respect
    the form's "off", but not for "password" inputs.
    -->
    <input id="real-username" type="text" autocomplete="nope">

    <!--
    <input type="password" autocomplete="new-password" will turn it off for passwords everywhere
    -->
    <input id="real-password" type="password" autocomplete="new-password">

    </form>