Change "read only" field color on case form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2018 01:23 PM
Hi,
We have "opened by" field as read only and we want to change the color of it to red. Now when its not read only i am able to change the color to red with the help of below client script but when its read only i am not able to. Any suggestions?
Script -
function onLoad() {
var x = g_form.getReference('opened_by');
var openedByField = g_form.getElement('sys_display.' + g_form.getTableName() + '.opened_by');
if (x.vip == 'true')
openedByField.setStyle({color : "red"});
else
openedByField.setStyle({color : ""});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2018 07:14 AM
Try below script :
g_form.getControl(<field>).style.backgroundColor = color;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2018 10:03 AM
Hello Gupta,
Below is the script -
function onLoad() {
var x = g_form.getReference('opened_by');
var openedByField = g_form.getElement('sys_display.' + g_form.getTableName() + '.opened_by');
if (x.vip == 'true')
openedByField.setStyle({color : "red"});
else
openedByField.setStyle({color : ""});
}
Can you guide me where to include the above script you have mentioned?