Friday, June 02, 2006

Changing/Hiding Form Labels

I've noticed a lot of posts in message groups about hiding or changing the label on a given field on a form. And there have been some really great scripts found to hide or even change the name of the field on the form. For those of you who haven't seen how to do it the script code is this:


The "_c" is the key to allowing you to then go on and use .innerText to change the Label value, or .style.visible for hiding the label.

These scripts work well but the problem with them is that they are not supported and in the next upgrade we may have to go back and change all of our code.

There is an even easier way to hide a label or change its name than through script and its supported. I wish I could say the same for hiding a field but I have yet to find one.

So, what is this supported way? Well, its something so simple I'm sure everyone who's customized CRM has seen it but, like me, they don't pay any attention to it any more and forget that its there.

If you go to the Customization portion within Settings, open up the Form and double click on the field whose label you want to change or hide. The first text box is the name of the label. Just type in there to change what gets displayed on the form as the label of that particular field. Please note that this will NOT change the field's name in Advance Find, you would need to go to the Attributes section and change the Display Name of the attribute for that.

Now, the thing that I figure most people overlook (like I did) is the checkbox labeled "Display label on the form." If you uncheck that checkbox the label on the form will disappear and the textbox on the form will fill in the space of the label.

The only downside to using this approach is that it is a static setting. No dynamic renaming or hiding of the field. But this does the same thing as the scripts, only its supported and actually easier than going out and having to figure out the code to hack the CRM forms.