tags:

views:

155

answers:

4

Is it possible to use CSS to disable autocomplete on a form element (specifically a textfield)?

I use a tag library which does not permit the autocomplete element and I would like to disable autocomplete without using Javascript.

+1  A: 

CSS does not have this ability. You would need to use client-side scripting.

Jonathan Sampson
A: 

I dont think it is possible using only css.

John Boker
+2  A: 

You can use a generated id and name everytime, which is different, so the browser couldn't remember this text-field so he can't suggest some values.

codedevour
+1  A: 

As it stands, there is no 'autocomplete off' attribute in CSS. However, html has an easy code for this:

<input type="text" id="foo" value="bar" autocomplete="off" />

If you're looking for a site-wide effector, an easy one would be to simply have a js function to run through all 'input' s and add this tag, or look for the corresponding css class / id.

RobertsonM