Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created August 26, 2014 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miohtama/d3fae1eddad9d5ea65e1 to your computer and use it in GitHub Desktop.
Save miohtama/d3fae1eddad9d5ea65e1 to your computer and use it in GitHub Desktop.
Disable password autocomplete for Chome and Safari
{% comment %}
Fix broken autocomplete on Chrome.
Chrome tries to guess that username is before the password field on the form,
wrongly autocompleting the username to the amount field.
http://stackoverflow.com/questions/10938891/disable-autofill-in-chrome-without-disabling-autocomplete
{% endcomment %}
<input type="foobar" name="autocomplete_trap" id="autocomplete_trap" autocomplete="off" style="display: none;">
{% if form.password %}
{% include "bootstrap/field_vertical.html" with field=form.password %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment