Change color on variable after validation

Cat Scarberry
Tera Contributor

Hi there

I have a catalog item that has a variable called Cost Codes Validation that is a Yes/No question.  What I would like to do is that if the value is No then change the background color to Red.  If the value is Yes then change the background color to Green

 

Is this possible on a catalog item?

 

Thanks

Cat

1 REPLY 1

jMarshal
Mega Sage
Mega Sage

Not really, no...not using OOB catalog item forms, at least.

A good work-around or alternate solution (if you really like the idea of colour as a visual indicator) would be to position a rich text label next to the field, which changes based on the value (like traffic lights)...when you select "no" the label configured with red is displayed and when you select "yes" the label configured with green is displayed...but they would be stacked or side-by-side ...you aren't changing the background colour of the yes/no variable itself.

You have 3 variables:

> cost code validation as boolean yes/no
> cost code validation red as rich text label (configured with red text and/or background)
> cost code validation green as rich text label (configured with green text and/or background)

You then have a UI Policy or client script which controls the visibility of the red/green label (only one is visible at a time) and the labels are always RO.


EDIT = I assume you're referring to "background colour" of the custom yes/no variable, not the "background colour" of the form page itself...