I have done a lot of research on this, but I can not find anything that solves my problem.
I have autocomplete = "off" set in the form tag and all my input tags, but Safari continues to enter the automatically saved passwords into my form when the page loads, which causes an unwanted keydown event in the form in my JavaScript.
Any thoughts? I tried all kinds of hacks, such as completely removing these input fields from the code, and then using javascript and setTimeout to insert them into the page after a few seconds, but even after that Safari still throws the saved passwords to my inputs,
I also tried using the autocorrect = "off" and autocapitalize = "off" attributes in my and tags.
I tried Javascript hacks like this (example):
$(function() { $('input').attr('autocomplete', 'off'); });
So every input field on the page at startup has this attribute, and yet Safari still inserts the saved passwords into the fields.
Yes, the page uses html5 doctype (because I know that autocomplete would not work without it).
Here is my code:
- form_for @website, :html => {:class => 'fields', :autocomplete => 'off'}, :url => {:controller => 'signup', :action => 'connect'} do |form| %h3 Enter URL %ol.fields %li = form.label :url, "Website URL:" = form.text_field :url, :placeholder => "Website URL", :autocomplete => "off", :class => "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 => "SFTP", :autocomplete => "off" %li = aa.label :account, "Username:" = aa.text_field :account, :placeholder => 'Username', :autocomplete => "off" %li = aa.label :password, "Password:" = aa.password_field :password, :placeholder => 'Password', :autocomplete => "off"
The foregoing in haml. This is a ruby โโapp. It inserts my passwords into the input: account and password entry :. I tried wrapping part of the name "my": the login for the account in span tags as follows:
User<span>n</span>ame
due to the fact that the word "name" is a trigger for autosaved passwords, but safari still throws the saved passwords into my form after this attempt to resolve this issue.
I would really appreciate some new tips that I could try. All that I have found so far for this problem, people just say "use autocomplete =" off. "I am, but it does not work!
In addition, I tested this with Safari 6.1.2, but confirmed this strange behavior with both old and new versions of Safari. A link to a screenshot of the browser overview, so I know that the autocomplete = "off" attribute is added to the elements: http://imgur.com/Sgqn7A4