I am trying to use a case statement that would change the background color of a numeric text field depending on the value of the field. I thought it would look something like this but it doesnt work can anyone help straighten me out?
You’re missing a default return case - the expression might be quietly failing as a result:
what would the return case be in regards to changing color?
I think he meant default return
returnDefault on the page PGriffith linked.
Exactly - so if you’re putting this binding on
backgroundColor, then maybe the default value is just an empty string:
Or in some cases you may need one of the meta-keywords like
inherit - CSS: Cascading Style Sheets | MDN
Alright, I think I understand. I’ll try it out and hollar back if I need more help. THANKS
Commas are missing as well, and those quotes copied from outside of preformatted code won’t work
Also, I couldn’t help but reformat how I like to format my case statements
@nminchin im surprised you didnt change the rgb values to hsl
Look back at my edit history
then I realised that you can’t use hsl here
Thanks alot guys! syntax is “B”, lol!
Hmm? You should be able to use the
just like this code is using the