# CMS Filter - update filter value via function call

**URL:** https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676
**Category:** Attributes
**Created:** [May 18, 2023, 7:02pm UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676 "2023-05-18T19:02:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![moorrr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/moorrr/32/520_2.png) [@moorrr](https://forum.finsweet.com/u/moorrr)
#### Post date: [May 18, 2023, 7:02pm UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676/1 "2023-05-18T19:02:44Z")

</div>

Hi!

I’m using CMS Filter for Search functionality on my website, and the only thing that filters CMS items is the text input field, where users type in their queries.

I’m wondering if there’s a JS function like `updateResults("search-input", "value")`, which will filter the results after being applied.

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: [May 18, 2023, 8:49pm UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676/2 "2023-05-18T20:49:43Z")

</div>

Hey @moorrr!

I’m not sure I understand your question. Do you have multiple filters on the page and only Search is working?

Do you want the users to submit the filters after they are done typing?

Could you share a read-only or live site link?

---

<div class="post-metadata">

### Author: ![moorrr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/moorrr/32/520_2.png) [@moorrr](https://forum.finsweet.com/u/moorrr)
#### Post date: [May 19, 2023, 7:30am UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676/3 "2023-05-19T07:30:40Z")

</div>

Hey @Support-Luis!

I have 2 text inputs - one is connected to FS CMS Filter, and another one is not.

The idea is to mirror the value from Input #1 (not connected to CMS filter) to Input #2 (Connected to CMS filter), and based on the mirrored text update the search results.

I’ve been trying to mirror the input value via jQuery $.val(), but CMS Filter ignores the change of $.val().

So I’m thinking if there’s a function that I can use to trigger the update of the search results to be displayed.  
Something like `updateFilter("by-title", "search-query")`.

P.S. unfortunately I can’t share the link due to NDA.

Thank you! 🙂

---

<div class="post-metadata">

### Author: ![josephmukunga](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/josephmukunga/32/522_2.png) [@josephmukunga](https://forum.finsweet.com/u/josephmukunga)
#### Post date: [May 19, 2023, 9:53am UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676/4 "2023-05-19T09:53:07Z")

</div>

Hey @moorrr, the issue with using jquery to mirror is that it does not trigger the input event. You can use our [mirror attribute](https://www.finsweet.com/attributes/mirror-input-values) solution instead

---

<div class="post-metadata">

### Author: ![moorrr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/moorrr/32/520_2.png) [@moorrr](https://forum.finsweet.com/u/moorrr)
#### Post date: [May 19, 2023, 9:59am UTC](https://forum.finsweet.com/t/cms-filter-update-filter-value-via-function-call/676/5 "2023-05-19T09:59:58Z")

</div>

@josephmukunga thank you so much! It worked 🙂
