/    Sign up×
Community /Pin to ProfileBookmark

i located the following code to stop the google toolbar from autfilling fields with that nasty yellow color. it works fin in IE but not firefox, any ideas?

[code=html]if(window.attachEvent)
window.attachEvent(“onload”,setListeners);

function setListeners(){
inputList = document.getElementsByTagName(“INPUT”);
for(i=0;i<inputList.length;i++){
inputList[i].attachEvent(“onpropertychange”,restoreStyles);
inputList[i].style.backgroundColor = “”;
}
selectList = document.getElementsByTagName(“SELECT”);
for(i=0;i<selectList.length;i++){
selectList[i].attachEvent(“onpropertychange”,restoreStyles);
selectList[i].style.backgroundColor = “”;
}
}

function restoreStyles(){
if(event.srcElement.style.backgroundColor != “”)
event.srcElement.style.backgroundColor = “”;
}
[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@peteybauthorJul 17.2006 — anyone?

i would appreciate any help in this matter. Is it that the code is based on IE error?
Copy linkTweet thisAlerts:
@A1ien51Jul 17.2006 — Why bother changing a 3rd party component? That color is to help the user know they can click a button to fill it in.

You can try to change the bgcolor after page load.

Eric
×

Success!

Help @peteyb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...