-2

This has been bugging me for a while and i was wondering how to prevent it in code. I am using safari to test my code and i have lots of forms, when i type in something that starts with the same letters, safari puts up this stupid bar. I was wondering if that is possible to prevent.

enter image description here

Thanks for the help!

Emilio Gort
  • 3,475
  • 3
  • 29
  • 44
  • Have you tried looking into the HTML reference of your choice about that? – hakre Sep 07 '13 at 22:49
  • Or perhaps into the manual of the Safari browser you're concerned about? – hakre Sep 07 '13 at 22:58
  • According to your accepted answer, you might be interested in: [Override browser form-filling and input highlighting with HTML/CSS](http://stackoverflow.com/q/2338102/367456) and [Is there a W3C valid way to disable autocomplete in a HTML form?](http://stackoverflow.com/q/582244/367456) – hakre Sep 07 '13 at 23:26

3 Answers3

5

Try this in your forms:

autocomplete="off" this should fix the issue for all modern browsers.

<form name="form1" id="form1" method="post" autocomplete="off"
   action="http://www.example.com/form.cgi">
  [...]
</form>

In current versions of Gecko browsers, the autocomplete attribute works perfectly. For earlier versions, going back to Netscape 6.2, it worked with the exception for forms with "Address" and "Name"

Documetation

Emilio Gort
  • 3,475
  • 3
  • 29
  • 44
2

try adding this attribute to your input field:

autocomplete="off"
Liam Allan
  • 1,115
  • 1
  • 8
  • 13
0

In Safari, go to Preferences > AutoFill and uncheck Other Forms.

timgavin
  • 4,972
  • 4
  • 36
  • 48