# Custom Form Select Resets Another

**URL:** <https://forum.finsweet.com/t/custom-form-select-resets-another/4011>\
**Category:** Attributes\
**Tags:** cmsfilter, cmsnest, selectcustom, cmsselect\
**Created:** [January 1, 2025, 9:14pm UTC](https://forum.finsweet.com/t/custom-form-select-resets-another/4011 "2025-01-01T21:14:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![david6](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/david6/32/3502_2.png) [@david6](https://forum.finsweet.com/u/david6)\
**Post date:** [January 1, 2025, 9:14pm UTC](https://forum.finsweet.com/t/custom-form-select-resets-another/4011/1 "2025-01-01T21:14:33Z")

</div>

Hello!

I have a section that utilizes CMS Filter, Custom Select, CMS Select, and CMS Nest.

See attached image:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/finsweet1/original/2X/3/3179ff068273c714a9c5d33f33a5c0f2a2c19bb4.png)

The issue is with the section pictured above. Specifically with clearing/resetting the active filter. Is it possible to have 1 dropdown clear the other? Currently the functionality allows for both filters to be applied to the collection list below. I’d like it so that only 1 can be actively filtering at a time. When selecting one drop down it would clear the other.

[Read-Only](https://preview.webflow.com/preview/artemis-canada-backup?utm_medium=preview_link&utm_source=designer&utm_content=artemis-canada-backup&preview=b807f185ab3623cb11a86cff64f59d4d&pageId=675c446df0adea479ba9f901&workflow=sitePreview)  
[Staging Link](https://artemis-canada-backup.webflow.io/)

Appreciate any help!

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [January 6, 2025, 8:58pm UTC](https://forum.finsweet.com/t/custom-form-select-resets-another/4011/2 "2025-01-06T20:58:41Z")

</div>

Hey @david6! We can achieve this with some custom code.

I have tested this script on my end and it seems to be working as expected. Please add it to the `</body>` section of the page and let me know how it goes!

```js
<script>
  window.fsAttributes = window.fsAttributes || [];
  window.fsAttributes.push([
    'cmsfilter',
    (filterInstances) => {
      console.log('cmsfilter Successfully loaded!');

      const [filterInstance] = filterInstances;
      const domainDropdown = document.querySelector('[fs-cmsfilter-field="domains"]');
      const functionDropdown = document.querySelector('[fs-cmsfilter-field="functions"]');

      const getOptions = (dropdown) =>
        Array.from(dropdown.parentNode.children).filter((option) => option !== dropdown);

      const domainOptions = getOptions(domainDropdown);
      const functionOptions = getOptions(functionDropdown);

      domainOptions.forEach((option) => {
        option.addEventListener('click', () => {
          console.log(`functions filter reset triggered!`);
          filterInstance.resetFilters(['functions']);
        });
      });

      functionOptions.forEach((option) => {
        option.addEventListener('click', () => {
          console.log(`domains filter reset triggered!`);
          filterInstance.resetFilters(['domains']);
        });
      });
    },
  ]);
</script>

```

---

<div class="post-metadata">

**Author:** ![david6](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/david6/32/3502_2.png) [@david6](https://forum.finsweet.com/u/david6)\
**Post date:** [January 8, 2025, 10:17pm UTC](https://forum.finsweet.com/t/custom-form-select-resets-another/4011/3 "2025-01-08T22:17:58Z")

</div>

Hey @Support-Luis, this worked perfectly. Appreciate your help!
