Input not to remember history

Hello

I remember i used to add a piece of code the HTML text input field so that no previous entries menu drops down anymore whenever you visit the page again and type in the same field… can you please remind me what to be added to the input tag? many thanks…

Are you talking about value=“”?

<input type="text" name="username" value="" />

No i meant, i don’t want the drop down menu to appear when you type in showing what was entered previously… i don’t want the remember list to appear…

Correct me if I am wrong, but I believe that is a browser controlled feature.

Mm i remember i used to make some input fields that do not display a drop down menu whenever you type in…

There’s a non-standard attribute (can’t remember the name) that works in some browsers, but overriding such built-in features is not a good idea. Especially not if it requires invalid markup.

If you don’t want the suggestions showing then disable that option in your browser.

There is a nonstandard attribute, autocomplete=“off”, that you can use to disable this. Your page won’t validate if you use this. It only works because online banking sites pressured browser makers into supporting this attribute.

I guess I won’t surprise anyone to mention that autocomplete=‘’ has been in HTML5 since 2004?

autocomplete=“off”

This is it, thank you:).

The real question is will it stillbe there in 2025 when that standard is finally adopted (if it ever is).

Do you have any reason to believe that browsers would drop support for it?

The move is toward giving the browser owner more control of how their browser works and so it is likely that browsers will soon offer an option to turn that off in the web page for those who want their browser to make the suggestions on what the field might contain. Just about every other option that web pages can ask to turn off can now be turned back on by the browser owner so leaving out that one is an anomaly that should soon be rectified.

Right… HTML5 allows this (last paragraph in http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#the-autocomplete-attribute ).

Had a thought a few minutes ago about a more standards-compliant way of doing this.

You could generate a random string using a server-side language of your choice and set that as the name attribute of the input field for which you don’t want autocomplete to detect.

You’ll also need to set the same string as the value attribute of a hidden field which would also be passed to your form handling script.

The script could then grab the value of the hidden field to get the name of the text field. Does this make sense?

I moved a post to a new topic: Reset HTML form fields (avoid undo capability)