Skip to content

Commit f2789dc

Browse files
authored
Remove Choice Options Client Script (#1613)
* Create Remove Options from Choice List.js This script is used to hide the choice options on Onchange. * readme.md This file explains the purpose of the script and how to use it.
1 parent d2538cf commit f2789dc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
2+
if (isLoading || newValue == '') {
3+
return;
4+
}
5+
if (newValue == 'inquiry') { //Onchange of Category
6+
g_form.removeOption('impact', '1');
7+
g_form.removeOption('urgency', '1');
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**Purpose:**
2+
This onChange function automatically reacts when the "Category" field is changed. If the new category selected is "inquiry," the function removes the options for "Impact" and "Urgency" that have a value of 1.
3+
Whenever a user selects a new category, the script checks if it’s set to "inquiry." If so, it removes the specified options for "Impact" and "Urgency".
4+
**How to Use This Function**
5+
You can use this Onchange client script on any form and maanage your field choice options.
6+

0 commit comments

Comments
 (0)