php color change

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a form that I have designed with colors. I am using php code to color  
it depending upon other values.

On my pc the colors are ok. From a friends pc every field with the word  
email in had a different colour. When I change the spelling of "email" to  
"emial" the colours displayed on his pc revert back to the colours I have  
set. We are running identical versions of windows and msie. Except mine is  
the Swedish version and he has the English version.

The offending field contains a text label and an input control. If either  
the text label or the name of the input control contains the word "email"  
the colors are morphed. The main problem with this was that the input field  
was changed to yellow text on a yellow background.

Is this because I am supplying the colors by php code or is it a problem for  
all forms? What I can not fathom is why he has different colors to the ones  
I have designed and why this "feature" was not displayed on my pc. We both  
use std settings in MSIE.

Garry Jones

Re: php color change

Does your friend have google toolbar installed? If so, turn off the
toolbar and the fields will go back to normal.


Re: php color change

rlee0001 schrieb:
Quoted text here. Click to load it
The existence of Google Toolbar might be a reason to avoid yellow text  
in form fields, except if you don't mind to display a notice that asks  
all your users to turn off their toolbars, or to check for the toolbar  
with client side scripting trickery.

BTW I suggest to avoid too much styling on form fields, as their general  
appearance is quite conventional, and the more your field looks  
different from common form fields, the less it will be recognized as a  
form field - which reduces the usability of your form. I don't see a  
reason for negative text in dark colored form fields, except "looking  
different", which may be cool if applied to the overall appearance of a  
site, but bad in the places where functionality is required.


Re: php color change

Since the HTML source must be identical on both clients, this is no
longer a PHP problem.

You should blaim Microsoft for its horrible browser... or maybe your
invalid markup?

Re: php color change

Hi Garry,

As Robert has suggested turn off the Google toolbar on your friend's
pc. If your friend's pc has Google toolbar installed and values are set
for AutoFill then the mentioned problem will occur. "email" is a common
keyword that people uses to name their form input text field, and is
picked up by Google's AutoFill feature, changing the color to Yellow.
Either turn off the Toolbar or change the field's name. Either way it
should work fine.

Thanks and God Bless!!


Re: php color change

Quoted text here. Click to load it

Hi Garry,

Further to Robert & Ehsan's comments on Google Toolbar Autofill,
you can find a javascript solution to the 'feature' at:


Site Timeline