Forums › Forums › Search & Filter Pro › Reset filters with javascript
Tagged: javascript, reset, trigger
- This topic has 26 replies, 3 voices, and was last updated 4 years, 7 months ago by Ross.
-
Ross Moderator(Private) April 8, 2020 at 11:57 am #239413
Hi David
So I’m not seeing what you are – my tests are behaving as expected…
Can you try removing the last
$('.searchandfilter').submit();
so we can see what happens, it should change the value, but no refresh of form or results.Also, can you remove the CSS that hides teh field, while we test?
Thanks
Ross Moderator(Private) April 8, 2020 at 3:51 pm #239449Ahhh, I can see the issue I think…
The issue is, once you make some selections in the other fields, the first deparment field is auto updated, and has maybe 1 option left (because its dynamic, and based on the other filters)….
So when you set your select to the value you want with JS, the actual option within the select doesn’t even exist, so it effectively does nothing.
What might work, is disabling “hide empty” option inside your department field, so they are always all shown.
Let me know if that works!
-
AuthorPosts