Disable auto-fill in specific form fields

Hi,
Not sure which category to post this under. I have a website that only I use personally for entering data into a DB. I’d like to be able to disable the auto-fill feature on only 2 text input fields since for some reason when I enter something, sometimes it puts in another number already in the auto-fill or cache or whatever.

So my question is…is there a way to just turn off that auto-fill feature on just those 2 text fields? So that whatever I’ve typed in them before won’t be remembered in there?

No, there isn’t, and if there were, it’d be a usability nightmare. The closest you might be able to get would be to either disable auto-fill ins in your browser or write a Greasemonkey-style script.

Are you sure? I’m sure I’ve seen secure sites like banks disable the autofill for things like usernames and online shops that accept credit cards don’t store these details so I’m sure it would be possible… no idea how they do it though.

There is no standards-compliant way to do it, but I think there is some proprietary attribute that works in IE. As Dan said, though, it’s not something you should do. Auto-fill is a feature in some browsers, and it’s up to the user to decide whether or not to use it. Never mess with your visitors’ browsers.

For banks and shops it could have to do with SSL. I’m not sure, but it seems likely that auto-fill would be disabled over HTTPS.


<form autocomplete="off">
...
</form>

That’s the IE way at least, iirc

I could see a couple of good reasons for turning autocomplete off, i.e. writing your own autocomplete text field in JS that uses your database results as options instead of previously-filled values. But you should tread lightly whenever you modify browser behavior like this since it’s typically not what users expect out of a form field.

Yeah exactly I agree with all of you on not altering the form filled auto-fill feature. But like I said this specific site is for my personal use only. No one else uses it. So basically I can do whatever I want with it. And for these 2 particular fields only it would be much better to not have the auto-fill feature since it’s actually causing problems with entering my data.

But I wouldn’t normally disable this feature on the public sites that I build. Thanks for all the input. I’ll try the form autocomplete=“off” and see if that helps.

<input autocomplete='off'>

http://www.whatwg.org/specs/web-forms/current-work/#the-autocomplete

autocomplete=“off” works just perfectly…now there’s less chance for error in my data input.

Thanks everyone!