Skip to content

Commit 0e05c51

Browse files
authored
On Change Client Script : Display Section based on State (#1565)
* Create README.md * Create script.js
1 parent 7566048 commit 0e05c51

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Display Section Based on State
2+
3+
## Overview
4+
This client script dynamically displays specific sections on a form based on the selected State field value. It improves user experience by hiding or showing relevant sections as needed.
5+
6+
## How It Works
7+
- When the State field changes, the script checks the new value.
8+
- For Example, if the state is changed to "Resolved", the Resolution Section becomes visible.
9+
- For other states, the section remains hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
2+
if (isLoading || newValue === '') {
3+
return;
4+
}
5+
6+
if (newValue == 6) //State on which section needs to be displayed
7+
g_form.setSectionDisplay('resolution_information', true); //Section which needs to be display
8+
else
9+
g_form.setSectionDisplay('resolution_information', false);
10+
}

0 commit comments

Comments
 (0)