How do I change the text color in a read only field?

This question has suggested answer(s)

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?

All Replies
  • 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

  • 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