# Disabling Instant Filtering in CMS Filter - Trigger with Enter Key Only

**URL:** <https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367>\
**Category:** Attributes\
**Tags:** cmsfilter, attributes-api\
**Created:** [September 4, 2024, 6:58am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367 "2024-09-04T06:58:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![juicydisorder](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/juicydisorder/32/6481_2.png) [@juicydisorder](https://forum.finsweet.com/u/juicydisorder)\
**Post date:** [September 4, 2024, 6:58am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/1 "2024-09-04T06:58:11Z")

</div>

Hey there!

I have a question about the CMS filter attributes. I’m setting up a search function using a single text input field for location searches. I want to disable the default instant filtering so that the filtering happens only after the user presses Enter. There’s no visible submit button; it’s all about keeping the design clean and minimal.

Is there a way to set up the filtering so it only triggers on an Enter keypress without showing a submit button? Any guidance or examples would be really helpful.

Thanks!

---

<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:** [September 4, 2024, 10:24am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/2 "2024-09-04T10:24:40Z")

</div>

Hey @juicydisorder! We may be able to achieve this with some JS. Can you share a link?

---

<div class="post-metadata">

**Author:** ![juicydisorder](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/juicydisorder/32/6481_2.png) [@juicydisorder](https://forum.finsweet.com/u/juicydisorder)\
**Post date:** [September 4, 2024, 11:00am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/3 "2024-09-04T11:00:53Z")

</div>

This would be great! I would send you the link in private

---

<div class="post-metadata">

**Author:** ![avivtech](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/avivtech/32/568_2.png) [@avivtech](https://forum.finsweet.com/u/avivtech)\
**Post date:** [March 5, 2025, 10:48am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/4 "2025-03-05T10:48:28Z")

</div>

@Support-Luis is there a chance of posting this JS here?

---

<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:** [March 6, 2025, 11:50am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/5 "2025-03-06T11:50:18Z")

</div>

Hey @avivtech! The JS needed depends on the setup. @juicydisorder had written some code, and I just added this

```js
  const input = document.querySelector('[fs-cmsfilter-field="plz"]');

  input.addEventListener('input', (e) => {
    e.preventDefault();
  });

  // add event listener to submit button
  submitButton.addEventListener('click', () => {
    console.log('submit button clicked');
    filterInstance.applyFilters(); // this line triggers the filtering
  });

```

You can share a link, and I’ll adjust the code to suit your setup 😉

---

<div class="post-metadata">

**Author:** ![de.skaaa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/de.skaaa/32/3766_2.png) [@de.skaaa](https://forum.finsweet.com/u/de.skaaa)\
**Post date:** [September 5, 2025, 6:57am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/6 "2025-09-05T06:57:59Z")

</div>

Hey @Support-Luis , could you please put together a code for the same setup for me? [[here]](https://preview.webflow.com/preview/elevatestage?utm_medium=preview_link&utm_source=designer&utm_content=elevatestage&preview=67917da35f206f5899a2d798eb8f438b&pageId=68ad7bef1f31e1e9f31adf30&locale=en&workflow=preview) is the read-only for the project.

many many thanks!

---

<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:** [September 10, 2025, 12:24am UTC](https://forum.finsweet.com/t/disabling-instant-filtering-in-cms-filter-trigger-with-enter-key-only/3367/7 "2025-09-10T00:24:37Z")

</div>

Hey @de.skaaa! Absolutely! Here is the snippet adjusted to your project!

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

      const [filterInstance] = filterInstances;
      const { submitButton } = filterInstance;

      const input = document.querySelector('[fs-cmsfilter-field="*"]');
      console.log(input);

      input.addEventListener('input', (e) => {
        e.preventDefault();
      });

      // add event listener to submit button
      submitButton.addEventListener('click', () => {
        console.log('submit button clicked');
        filterInstance.applyFilters(); // this line triggers the filtering
      });
    },
  ]);
</script>

```
