tags:

views:

68

answers:

2

I've just been given a requirement to prevent browsers from saving data entered into specific form fields. It's been years since I've done web dev, and this is a relatively new capability. I was able to find the form field property autocomplete="off", but I can't seem to find any documentation indicating which browsers support it. Can anyone point me in the right direction of a chart of form attributes and browser compatibility?

+1  A: 

I can only offer anecdotal evidence, but I've yet to come across a browser that fails to respect autocomplete="off", this experience covers:

  • Firefox 1.5+ (Windows and Ubuntu)
  • Opera 6+ (Windows and Ubuntu)
  • Chrome v2+ (Windows and Ubuntu)
  • Epiphany 0.8 (ish) (Ubuntu)
  • Midori (I can't remember which version)
  • Safari v1+ (Windows)
  • IE 4 - 8, Windows.

I'm aware that Greasemonkey scripts, and presumably other user-scripts, can disable the autocomplete setting.

There's a couple of articles I found that might be useful to you:

  1. How to turn off form auto-completion
  2. Using auto-complete in html forms
David Thomas
Thanks for those articles. I know that there are scripts that can disable the setting, but there's only so much we can do. If someone wants their browser to save their credit card info on their personal computer, there's not much we can do to prevent it. We're really trying to keep data from being saved on shared machines.
EmmyS
@EmmyS, no that's true. It'd take a fairly tech-aware user to go to the trouble of implementing an anti-auto-complete solution, and what users *do* with your site on their machines is down to them, not you. =)
David Thomas
A: 

if you have js at hand and can use it then try jquery like this on load of the html $('#theform input').value();

ITroubs
This is being used inside Joomla, which uses Mootools - there are conflicts with mootools and jquery, so I can't do that. I'll keep it in mind for future reference, though.
EmmyS
refering to mootools documentation you can do $$('.emptyThisInForm').each(function(el){ el.value = '';});
ITroubs