Question Status

Suggested Answer
Ryan Dorn asked a question on 23 Aug 2011 2:38 PM

I'm using read only fields to instruct users how to complete a form in Microsoft CRM 2011.  The default text color is a light gray that's hard to read, does anyone know how to change the text color to black?

Reply
Inogic responded on 24 Aug 2011 3:46 AM

Hi,

You can change the background color of any text field using below script. This also works for read only field,

document.getElementById('<Field-SchemaName>').style.backgroundColor="black";

HTH!

Inogic

Innovative Logic  

Web: www.inogic.com

Blog: http://www.inogic.com/blog

twitter: @inogic

Reply
Suggested Answer
Inogic responded on 24 Aug 2011 4:16 AM

Hi,

Just found that you need to change color of text and not background. Note if you are making field read only either from form itself or from script then below single line of script will not work. You need to make field read only from script as explained below.

document.getElementById('<Field Schema Name>').style.color="black";

Instead of making field readonly from form, you need to set “read only” property of field from script as per below line of script. This way field will remain read only and you can also change the color of text.

document.getElementById('<Field Schema Name>').readOnly = true;

So to achieve your feature use above 2 line of script.

HTH!

Inogic

Innovative Logic  

Web: www.inogic.com

Blog: http://www.inogic.com/blog

twitter: @inogic

Reply
Suggested Answer
Inogic responded on 24 Aug 2011 4:16 AM

Hi,

Just found that you need to change color of text and not background. Note if you are making field read only either from form itself or from script then below single line of script will not work. You need to make field read only from script as explained below.

document.getElementById('<Field Schema Name>').style.color="black";

Instead of making field readonly from form, you need to set “read only” property of field from script as per below line of script. This way field will remain read only and you can also change the color of text.

document.getElementById('<Field Schema Name>').readOnly = true;

So to achieve your feature use above 2 line of script.

HTH!

Inogic

Innovative Logic  

Web: www.inogic.com

Blog: http://www.inogic.com/blog

twitter: @inogic

Reply