6

In my HTML FORMs, when I focus certain text fields they list down history of values entered previously. Is it possible to avoid this auto-drop-down? I am not looking for some browser settings tips for my computer, instead, I want these settings for all of the users of my website filling a form.

Will it also be possible to apply these settings for some selected text fields only? as historical values for some text fields may be helpful for a particular user using his/her machine.

May be this could be achieved using Javascript, but no clue where to start from.

Thanks for your help.

PS: I am using PHP and Javascript (JQuery).

TigerTiger
  • 10,034
  • 13
  • 54
  • 71
  • Name the field something crazy that they probably have never encountered before. :) – Tim Jun 29 '09 at 15:38
  • @Tim .. LOL .. but the solution I am looking for is for users using my website's forms again and again. – TigerTiger Jun 29 '09 at 15:40
  • Ah, ok.. Please disregard my comment then. :) – Tim Jun 29 '09 at 15:45
  • Note that if you have autocomplete="off" on a password field, Firefox will not save the password. However, if the password is already saved, it will be populated in a password field, even if autocomplete="off". – Daniel Vandersluis Jun 29 '09 at 16:07

3 Answers3

15

Add the attribute autocomplete="off" to each of your form elements.

This is not part of the W3C HTML standard, but it does work in both Mozilla & IE browsers.

Matt Bridges
  • 44,295
  • 7
  • 44
  • 59
3

Try autocomplete="off" in your <form> or <input> tag, see this Mozilla article, this MSDN page and this Safari Reference page for more info. Looks like Safari has only documented the use of the attribute on individual <input> tags though.

See also the answers to the question How can I prevent Firefox’s Autocomplete?

Community
  • 1
  • 1
Paul Dixon
  • 277,937
  • 48
  • 303
  • 335
0

I think that this is implemented in firefox using an internal table with field names and their history. You can try to generate a custom name for your fields (like "name-asdfg" instead of just "name"), which results in a form generation and processing overhead (you must strip the nonsense from the end of the name).

bandi
  • 4,028
  • 1
  • 23
  • 24