W3C home > Mailing lists > Public > www-validator@w3.org > July 2009

Re: How to turn autocomplete off

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sat, 18 Jul 2009 00:29:05 +0300
Message-ID: <A1679E3407C34317AE0F94B53853A73F@JukanPC>
To: <nijtram1@hotmail.com>
Cc: <www-validator@w3.org>
David Dorward wrote:

> M. Verbakel wrote:
>> I made a small form, but when i try to fill it in, i can't click on
>> the next field!
>> How can I, XHTML 1.0 Transitional valid, turn it autocomplete off?
>
> This mailing list is not the best place for HTML authoring questions.

Well, this is for validator-related questions. The question belongs to that 
category, broadly speaking, but its prelude is mysterious. However, let's 
skip it, as it does not look validator-related at all.

> That said, the short answer is: "You can't".

It depends. I would say that the following does the job on IE, and for other 
browsers, it's probably not possible anyway.

...
<body onload="init()">
...
<form ...>
...
<input id="foo" ...>
...
</form>
<script type="text/javascript">
function init() {
document.getElementById("foo").autocomplete = "off";
</script>

Of course this means turning autocomplete off outside HTML, namely in 
JavaScript, but in a manner that formally complies with HTML DTDs. Even 
XHTML 1.0 Transitional, should anyone want to use that oddity.

Why bother? Don't ask me. I just answered the question as it was posed.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Friday, 17 July 2009 21:30:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:36 GMT