JanineB Posted October 3, 2019 Report Share Posted October 3, 2019 How can I change the label color of my Virtual Field? Thanks. Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted October 3, 2019 Report Share Posted October 3, 2019 You can change it by this code: <style> td[data-cb-cell-name*="cbParamVirtualX"] { color: red !important; } </style> You may refer to this post for getting the Form Elements: I hope it helps! Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted October 21, 2022 Report Share Posted October 21, 2022 Hi - Just to add on this post, you may try this sample code if you would like to change the color of all Virtual Fields in the DataPage. <script> document.addEventListener('DataPageReady', function (event) { var elems = document.querySelectorAll("input[name*='cbParamVirtual']"); elems.forEach((elem) => { elem.addEventListener('change', function () { if (elem.value === 'CORRECT') { elem.previousElementSibling.style.color = 'green'; } else { elem.previousElementSibling.style.color = 'red'; } }); }); }); </script> This will make the font color Green if the value of the Virtual Field is CORRECT and if not, it will be Red. Hope it helps! Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted September 29, 2023 Report Share Posted September 29, 2023 Hi - Just an update, for dynamically changing the font color of field values based on a condition - you can use this solution/CSS: https://howto.caspio.com/tech-tips-and-articles/dynamically-changing-colors-of-values/ Quote Link to comment Share on other sites More sharing options...
Question
JanineB
How can I change the label color of my Virtual Field? Thanks.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.