Limit Finsweet CMS search to minimum characters

Got a Finsweet CMS filter question!

Trying to prevent search results from showing UNLESS all 4 digits are entered, but minlength and maxlength don’t do anything…

Anyone have a solution? Cheers!

As you can see above, the usual minlength attributes are ignored by Finsweet JS.

I’d double-check the docs but I don’t recall any form of min-length attribute in FS filter.

What you could do instead is have a separate un-attributed input + custom code, and then hide Finsweet’s. Then as the user types, if it’s 4+ digits, you update the filter input and trigger filtering. If it’s < 4 digits, you clear the filter input and trigger filtering.

Note that to trigger filtering from script, I recall you have to fire an event on the filtered input field, something like an input event, with bubbling on. That’s the only way to get the filter to trigger programmatically from script.