/* eslint-env browser, jquery */ /* global jQuery, GFFORMID */ /** * Disable Already-Selected Choices in a Nested Forms Child Dropdown (Batch-Scope) * * GOAL: * - Disables options in a specific child dropdown if those values are already used by other child entries in * the current Nested Forms batch/session. Re-enables options when entries are removed or edited. * * REQUIREMENTS: * - Gravity Forms and Gravity Perks Nested Forms. * * CONFIGURATION: * - Edit the cfg block below: * - parentFormId: ID of the parent form that contains the Nested Form field * - nestedFieldId: Field ID of the Nested Form field on the parent form * - childDropdownFieldId: Field ID of the dropdown on the child form * - compareBy: 'value' (recommended) or 'label' to compare against saved values or visible labels * * NOTES: * - Adds class 'bld-disabled-choice' to disabled