title: Safari saved passwords are overriding autocomplete="off" in forms
body: <p>I have done a ton of research towards this issue, but I can't seem to find anything that solves my problem.  </p>
  
  <p>I have autocomplete="off" set on my form tag, and all of my input tags as well, yet Safari continues to input auto saved passwords into my form on page load, which is causing an undesired keydown event on the form in my JavaScript.  </p>
  
  <p>Any thoughts?  I've tried all sorts of hacks like deleting those input fields from the code entirely, and then using javascript and a setTimeout to insert them into the page after a few seconds, but even after that Safari still throws in its saved passwords to my inputs.  </p>
  
  <p>I've also tried using the autocorrect="off" and autocapitalize="off" attributes in my  and  tags.  </p>
  
  <p>I've tried Javascript hacks like so (example): </p>
  
  <pre><code>$(function() {
      $('input').attr('autocomplete', 'off');
  });
  </code></pre>
  
  <p>So that every input field on the page on load has this attribute, and yet Safari still inserts its saved passwords into the fields.</p>
  
  <p>Yes, the page is using html5 doctype (Because I know autocomplete won't work without it).  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>  - form_for @website, :html =&gt; {:class =&gt; 'fields', :autocomplete =&gt; 'off'}, :url =&gt; {:controller =&gt; 'signup', :action =&gt; 'connect'} do |form|
      %h3 Enter URL
      %ol.fields
        %li
          = form.label :url, "Website URL:"
          = form.text_field :url, :placeholder =&gt; "Website URL", :autocomplete =&gt; "off", :class =&gt; "website_url"
      %h3 Enter Credentials
      - form.fields_for :authentication do |aa|
        %ol.fields
          %li
            = aa.label :hostname, "SFTP/FTP Server:"
            = aa.text_field :hostname, :placeholder =&gt; "SFTP", :autocomplete =&gt; "off"
          %li
            = aa.label :account, "Username:"
            = aa.text_field :account, :placeholder =&gt; 'Username', :autocomplete =&gt; "off"
          %li
            = aa.label :password, "Password:"
            = aa.password_field :password, :placeholder =&gt; 'Password', :autocomplete =&gt; "off"
  </code></pre>
  
  <p>The above is in haml.  It is a ruby application.  It is inserting my passwords into the :account input, and the :password input.  I have tried wrapping the 'name' part of my :account input in span tags like so:</p>
  
  <pre><code>User&lt;span&gt;n&lt;/span&gt;ame
  </code></pre>
  
  <p>because of the 'name' word being a trigger for autosaved passwords, yet safari still throws its saved passwords into my form after that attempt at solving this.</p>
  
  <p>I would greatly appreciate some new tips I could try.  Everything I've found so far for this problem, people just say "use autocomplete="off."  I am, but it's not working!</p>
  
  <p>Also, I've been testing this with Safari 6.1.2, but have confirmed this strange behavior with older and newer versions of Safari as well.  Link to screenshot of browser inspect, so I do know the autocomplete="off" attribute is properly being added to the elements: <a href="http://imgur.com/Sgqn7A4" rel="nofollow">http://imgur.com/Sgqn7A4</a></p>