The labels for data entry fields on CRM 3.0 forms can normally only be set to the following values: Normal, Hidden, or Disabled.  Not a whole lot of functionality there should you wish to get inventive ( or at least, more descriptive ) with your forms.

Using a bit of JavaScript in the Form's OnLoad event, you can alter the labels in a variety of ways.

 

Changing the Weight of the font ( how dark it is ): 

crmForm.all.[field name]_c.style.fontWeight = 'bold';

Possible values:

normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900

 

Changing the Font Style: 

crmForm.all.[field name]_c.style.fontStyle = 'italic';

Possible Values:

normal, italic, oblique

 

Changing the Background Color: 

crmForm.all.[field name]_c.style.backgroundColor = 'green';

Possible Values:

Named or value color

 

Changing the Font Color: 

crmForm.all.[field name]_c.style.color = 'green';

Possible Values:

Named or value color

 

Other style elements do exist, but to keep in mind that your changes do not need to vary the CRM user experience too much.

 

References:

Javascript style attributes

Hiding a Form Field Label in MSCRM 3.0

CRM 3.0 UI Style Guide

 

 

 

One Response to Changing Label Attributes on a MSCRM 3.0 Form

  1. uma_natarajan says:

    I used
    crmForm.all.[field name]_c.style.color = 'green';
    in forms onload event. but i got "crmForm.all.[field name]_c.style" is null or it's not an object error.

    What did i miss?.

    Thanks for helping

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>