2

I am trying to use the chrome extension Stylish to reenable autocomplete on forms that have it disabled.

Specifically, the form has it disabled by specifying autocomplete="off" and I want it re-enabled.

I tried using this:

form { autocomplete: on;}

and variations of it, but it does not work. I'm not sure if this is even an attribute you can override via CSS, let alone how to do it.

Trampas Kirk
  • 1,436
  • 3
  • 16
  • 21

3 Answers3

1

CSS affects what's inside style properties, and some of the old attributes (length/cellpadding/color etc). autocomplete is not one of those. JS is the right way.
Something on the lines of:

documnet.getElementById('element_id').autocomplete='on';
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
1

I installed Firebug, and used it to figure out the syntax, then wrote a crude script for Tampermonkey (Yes, those are for different browsers. I wanted this to work in Chrome, but knew firebug would be a quick way to figure out and test the syntax.):

// ==UserScript==
// @name       Autocomplete Enabler
// @version    0.1
// @description  enter something useful
// @include    http://*/*
// @include    https://*/*
// @copyright  2011+, You
// ==/UserScript==
var formcount=0;
var i=0;

for (i=0;i<=formcount;i++)
{
    document.getElementsByTagName('form')[i].setAttribute('autocomplete','on');
}

It worked, at least for my bank's website. I'll save form information if I want to!

Trampas Kirk
  • 1,436
  • 3
  • 16
  • 21
0

You could write an userscript to do that.

AKX
  • 152,115
  • 15
  • 115
  • 172
  • 1
    But it's still a solution to the problem at hand. Also... your solution is an userscript. What gives? – AKX Jul 09 '12 at 00:59