Skip to content

Instantly share code, notes, and snippets.

Last active Nov 13, 2020
What would you like to do?
Source code for
<style type="text/css">
.color_red {
background-color: red !important;
color: #fff !important;
.color_yellow {
background-color: yellow !important;
color: #000 !important;
.color_green {
background-color: green !important;
color: #fff !important;
"use strict";
/* replace llopn with the number field's key in the field's Advanced section */
$("#field_llopn").on("change", function () {
var num_value = $(this).val();
/* first remove any color classes that have already been applied
* change h6ub8 to the other field's key in the field's Advanced section
/* set the new color class */
switch (num_value) {
case "1" :
case "2" :
default :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment