-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!

4

3 回答 3

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

于 2013-09-07T22:49:49.583 回答
2

try adding this attribute to your input field:

autocomplete="off"
于 2013-09-07T22:49:06.097 回答
0

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

于 2013-09-07T22:56:01.280 回答