View Single Post
Old 02-09-2005, 02:17 PM  
leedsfan
leedsfan
 
leedsfan's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: purgatory
Posts: 2,564
Quote:
Originally Posted by AlCapone
Some of you may have noticed that when coloring your pages & sites with stylesheets, you end up with some of the text inputs on your forms a weird yellow color, for areas that have "auto-fill" content contained within them. The Google Toolbar causes this annoyance. This can be obnoxious if you have a light colored text for your form fields., so here's the fix.

Step 1: Copy the following code and paste it into notepad -
PHP Code:
  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);
    
selectList document.getElementsByTagName("SELECT");
    for(
i=0;i<selectList.length;i++)
      
selectList[i].attachEvent("onpropertychange",restoreStyles);
  }

  function 
restoreStyles(){
    if(
event.srcElement.style.backgroundColor != "" && event.srcElement.style.backgroundColor != "#a0d0ff"){
      
event.srcElement.style.backgroundColor "#a0d0ff"/* color of choice for AutoFill */
      
document.all['googleblurb'].style.display "block";
    }
  } 
Step 2: Save this file as "googlefix.js" or whatever you like.

Step 3: Paste the following code into the [head] of each of your documents where form elements are -
PHP Code:
<script type="text/javascript" src="googlefix.js"></script> 
That's it!

Enjoy!

thanks i was wondering what caused that
leedsfan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote