Conditionally color background of division if value of field is true

  • 1
  • Question
  • Updated 1 year ago
How do I conditionally color background of division if value of checkbox field (named agenda__c) is true?  Basically trying to highlight fields if the agenda checkbox is checked.
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Photo of Allison

Allison

  • 1,158 Points 1k badge 2x thumb
No, I get an error on the highlighted part
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k badge 2x thumb
It looks like you're mixing CSS and Javascript.  CSS (the highlighted section) needs to be added separately, like through the CSS resource on the page or externally through a static resource or other location.  All you should need to do in script is add the class.

Personally I try to avoid business logic in script and prefer to use parameters and to handle situations where data influences the UI.  This post might help out for you.

https://community.skuid.com/skuid/topics/css-for-template-fields