Skip to content

Commit 4c28f65

Browse files
authored
Script for field color coding
1 parent 8b66e69 commit 4c28f65

File tree

1 file changed

+15
-0
lines changed
  • Client-Side Components/Client Scripts/Color-coded Priority field for improved UX

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function onChange(control, oldValue, newValue, isLoading) {
2+
3+
var colorMap = {
4+
'1': '#e74c3c', // Critical - strong red
5+
'2': '#e67e22', // High - bright orange
6+
'3': '#f1c40f', // Moderate - yellow
7+
'4': '#3498db', // Low - blue
8+
'5': '#27ae60' // Planning - green
9+
};
10+
11+
var priorityField = g_form.getControl('priority');
12+
if (!priorityField) return;
13+
14+
priorityField.style.backgroundColor = colorMap[newValue] || '';
15+
}

0 commit comments

Comments
 (0)