How make a field 'True/False red when is true (in form view)?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2022 01:00 AM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2022 01:34 AM
Hi Kasia,
You can use the onload client script :
function onLoad() {
//Type appropriate comment here, and begin script below
var a = g_form.getValue('u_fast_track');
if (a == 'true') {
g_form.getControl('u_fast_track').parentNode.style.backgroundColor = 'red';
g_form.getControl('u_fast_track').parentNode.style.width = '50px';
}
if(a == 'false') {
g_form.getControl('u_fast_track').parentNode.style.backgroundColor = 'none';
}
}
Mark it helpful and Correct
Thanks and Regards
Anand Shukla
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2022 02:04 AM
Hi,
you can use onLoad client script
function onLoad() {
//Type appropriate comment here, and begin script below
var val = g_form.getValue('u_fast_track').toString();
if (val == 'true') {
g_form.getControl('u_fast_track').style.backgroundColor = 'red';
}
}
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader