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
05-31-2022 06:29 AM
Hi Lavanya,
in order to change the shape of a field, follow the below steps.
- Right click on the field label in the form you want to change the size for and select 'Configure Styles'.
- Select 'New' to create a new style for that field.
- In the 'Style' section add the following code
height: 25px;
width: 25px;
border-radius: 50%;
Adjust the height and width accordingly.
This should work perfectly fine. Let me know if you're facing any issue.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 11:59 AM
It's working. But the width is not getting adjusted as per my expectations. However little changes happening

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 12:56 AM
Hi Lavanya,
Can you share a screenshot of the changes you've made ? What value did you give for the height and width ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 02:12 AM