diff --git a/Client Scripts/Display Section on State/README.md b/Client Scripts/Display Section on State/README.md new file mode 100644 index 0000000000..66a72e9353 --- /dev/null +++ b/Client Scripts/Display Section on State/README.md @@ -0,0 +1,9 @@ +# Display Section Based on State + +## Overview +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. + +## How It Works +- When the State field changes, the script checks the new value. +- For Example, if the state is changed to "Resolved", the Resolution Section becomes visible. +- For other states, the section remains hidden. diff --git a/Client Scripts/Display Section on State/script.js b/Client Scripts/Display Section on State/script.js new file mode 100644 index 0000000000..7a30ecc2d4 --- /dev/null +++ b/Client Scripts/Display Section on State/script.js @@ -0,0 +1,10 @@ +function onChange(control, oldValue, newValue, isLoading, isTemplate) { + if (isLoading || newValue === '') { + return; + } + + if (newValue == 6) //State on which section needs to be displayed + g_form.setSectionDisplay('resolution_information', true); //Section which needs to be display + else + g_form.setSectionDisplay('resolution_information', false); +}