Jump to content

Pink, green and yellow text inputs


moon 111

Recommended Posts

In my website I set the bgcolor, text color etc. in css. It was white on a background of black. The problem is that when I view the page in my IE 7 the text feilds are mostly pink, yellow and green. The strange thing is that on some of the pages it's the wrong color and on others it's the correct one. I have some tool bars installed so it might be that. Oh, the reason I care is becuase it doesn't change the text color so it's very hard to read.

 

Thanks,

Moon 111

Link to comment
Share on other sites

I have no idea about the pink and green input background colors; but I pretty sure you are correct - it probably is your toolbars (unless your using a independent stylesheet/css style for each different browser type). Google toolbar automatically highlights commonly named fields - such as name, address, email, phone, and etc. - with a light yellow background color; too let you know you can auto fill the input fields with your saved info.

 

Here is a javascript workaround for that:

 

<script type="text/javascript"><!--
  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 = "";
  }//-->
</script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.