
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:27 AM
When I right click on a field on a form and "configure styles"...the setting of background-color:#d9e5ff; This does nothing to the form field itself....it does show and work on the list of forms. How can I get the background of the form field to display a color? Is there something special about it?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:51 AM
Field styles only apply in lists. You can do this to a field on a form with a client script though. Here is the syntax you would need in your function...
var myField = 'state';
var ctrl = g_form.getControl(myField);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';
If you're dealing with a reference field you'll need to do it like this...
var myField = 'assignment_group';
var ctrl = $('sys_display.' + g_form.getControl(myField).id);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 11:51 AM
Field styles only apply in lists. You can do this to a field on a form with a client script though. Here is the syntax you would need in your function...
var myField = 'state';
var ctrl = g_form.getControl(myField);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';
If you're dealing with a reference field you'll need to do it like this...
var myField = 'assignment_group';
var ctrl = $('sys_display.' + g_form.getControl(myField).id);
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'lightBlue';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 12:07 PM
Thanks so much! That is what I needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2022 04:35 PM
Is there documentation on all the possible things you can use after style? I.E. ctrl.style.fontSize, ctrl.style.italic etc.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 04:01 PM
Hello! I am also trying to add a color to a field on my case form, when another field (True/False) on the form is TRUE. I want to fill the 'Account' (account) field with a color if the 'CPM Account' (u_cpm_account) field is True (checked). I've tried configuring a style (Configure Styles) on the Account field, but it doesn't appear to be working. Should I be creating a Client Script instead? If so, how would I configure it for my use case?