Color Changing field based on the Choice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:37 AM
I have a requirement of changing color of a field based on the select box. In a Custom form, there is a choice field. Based on the choice, two string fields has to change its color and shape. I am able to change the color by writing the client script( found somwhere in the community). But it is possible to change the shape?
var grValue = g_form.getValue("u_relevance");
var myField = 'u_document_status';
var myAudit = 'u_audit_status';
var ctrl = g_form.getControl(myField);
var ctrl_one = g_form.getControl(myAudit);
if(grValue == 1)
{
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'Red';
ctrl_one.style.fontWeight = 'bold';
ctrl_one.style.backgroundColor = 'Red';
}
else
{
ctrl.style.fontWeight = 'bold';
ctrl.style.backgroundColor = 'Green';
ctrl_one.style.fontWeight = 'bold';
ctrl_one.style.backgroundColor = 'Green';
}
}
This script functions good. But normally the field will be rectangle in shape. Can I change it to round shape. Is it possible to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 02:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 02:15 AM
the dictionary attribute "age" maxlength is 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 03:49 AM
For rounded-shape, the height and width should be of same dimension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 04:43 AM
I saw this KB Article "https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0695430". The Width cannot be adjusted. Because it depends on the column