diff --git a/Client Scripts/Remove Option from Choice List/Remove Options from Choice List.js b/Client Scripts/Remove Option from Choice List/Remove Options from Choice List.js new file mode 100644 index 0000000000..8c3eed75ce --- /dev/null +++ b/Client Scripts/Remove Option from Choice List/Remove Options from Choice List.js @@ -0,0 +1,9 @@ +function onChange(control, oldValue, newValue, isLoading, isTemplate) { +if (isLoading || newValue == '') { +return; +} +if (newValue == 'inquiry') { //Onchange of Category +g_form.removeOption('impact', '1'); +g_form.removeOption('urgency', '1'); +} +} diff --git a/Client Scripts/Remove Option from Choice List/readme.md b/Client Scripts/Remove Option from Choice List/readme.md new file mode 100644 index 0000000000..87b4c9a229 --- /dev/null +++ b/Client Scripts/Remove Option from Choice List/readme.md @@ -0,0 +1,6 @@ +**Purpose:** +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. +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". +**How to Use This Function** +You can use this Onchange client script on any form and maanage your field choice options. +