As you know, CRM automatically adds a field label/description to any field on the data entry form ( as shown below ):
Occasionally, I have run into the requirement to hide the field label. This is easily done by unchecking the Display label on the form property of the field:
Unfortunately, this produces what I think is an undesirable result:
Want I really want is to have the actual edit field to remain where it was originally, lined up with the other edit fields. So, how do we get around this functionality? With a little ingenuity and JavaScript, of course.
Add the following line to the Form's OnLoad event:
crmForm.all.[fieldname]_c.style.color = "#EEF0F6";
All field labels are named exactly like the data entry fields, but with a "_c" appended to the end of the name.
In this example, we are changing the color of the text of the field label to match the Form's background color. This will, in effect, "hide" the label from the user, while keeping the form layout the same. Here is how it will actually look:
Pretty cool, huh?
NOTE: I found the color information used in this example by reviewing the sample stylesheet that is included with the CRM 3.0 SDK.
Update (2/18/06):
Ryan Farley has a great article that shows a similar technique for hiding an entire field.
So I'm making meat balls in Marinara sauce for lunch. As I'm loading up the Crock Pot with frozen meat balls and sauce, the following thought pops into my head:
Man, you could put someone's eye out with one of these.
I honestly have no idea how I come up with these things sometimes…




