Click to See Complete Forum and Search --> : Kill Google Autofill Script not working
dlacloche
11-07-2006, 01:26 PM
So, I'm trying to use the Kill Google Autofill Script extension in Dreamweaver, and it's not working. I found it here:
http://www.adobe.com/cfusion/exchange/index.cfm?view=sn121&extID=1011165
Here's the description:
Google Toolbars Autofill feature styles fields such as name, address, phone, email, etc. with a yellow background (AutoFill is turned on by default). The script kills the Google style setting.
The command is greyed out until input or select form elements are added to the document.
Here's the script:
<!--[if IE]>
<script type="text/javascript">
function killAutofill(){
is = document.getElementsByTagName("INPUT");
for(i=0;i<is.length;i++)
is[i].style.backgroundColor = "";
ss = document.getElementsByTagName("SELECT");
for(i=0;i<ss.length;i++)
ss[i].style.backgroundColor = "";
}
window.onload=killAutofill;
</script>
<![endif]-->
Can't figure out why it's not working. I'm not the greatest coder in the world, but it seems like a pretty straight forward script.
ryanbutler
11-08-2006, 05:52 PM
I don't think you can place script tags inside a conditional comment (I could be wrong). Take out the conditional comment and see if that fixes the problem.
Plus, using the window.onload function will kill any onLoad from the body argument if I understand all this unobtrusive JS stuff that seems slightly ridiculous from initial readings. I'd suggest taking that out, and calling the function on the body tag.
Hope that helps.
Compguy Pete
11-09-2006, 12:19 PM
I have to agree with Ryan.... I would also like to know the reasoning for disabling the google autofill?
I would think this would be just as well done by naming your form fields differently than the ones that are picked up by the auto fill. for example rather than name give it yourname1 or something like that.
dlacloche
11-09-2006, 12:51 PM
I thought about changing the field names so that google autofill wouldn't do the ugly yellow field thing, but it felt like that was a cheat.
But, if the dev community is okay with that work around, what the heck? I'll try it!
_Aerospace_Eng_
11-09-2006, 01:04 PM
This seems to work
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 = "";
}
}
A1ien51
11-09-2006, 01:21 PM
My 2 cents, throw this comment in the trash for all I care!
I always laugh about trying to avoid the yellow.
Why are developers afraid of the yellow color! And the common response is "It messes up the look and feel of the page!"
Everyone that has the toolbar knows what the yellow is. Changing field names and removing the color means a person will not know they can use the button on the toolbar to fill out the field. I know it saves me a few minutes of typing. I like that!
Ignore It, people know you are not insane with picking yellow on your webpage! Imagine if they used magenta or teal! If a client gets upset, send them to an introduction to the autofill feature in Google. They might like you when you show they they can save time!
Eric
dlacloche
11-09-2006, 02:33 PM
I agree. I don't care if the yellow fields are there, but my boss does. He seems to think it looks bad, and it confuses users. I tried to tell him to chill, but he's insistant about losing the yellow.
I feel like, if I don't find a fix, he'll think I'm a big fat loser.
A1ien51
11-09-2006, 02:44 PM
when he is not looking go on his machine and disable the toolbar!
We all have been in your shoes many times!
Eric
dlacloche
11-09-2006, 02:53 PM
That's funny. I've already done that in the conference room.
felgall
11-09-2006, 04:16 PM
Anything set in the browser is supposed to override anything set by the web page so if the browser says make fields yellow it means that the person viewing the page using that browser wants them that way. If that isn't true then change the browser settings and not the web page.
Compguy Pete
11-09-2006, 04:21 PM
ya know now that I know more of hte background story... he needs to also see that most users of the google toolbar will know why it's yellow and perhaps be more willing to fill it out if they know they wont need to type in the information.
I would say just speaking of myself I'm a lot happier when I don't have type in my long lastname and address for the millionth time on some stupid request form.