Using Submit and reset together
Hello @patrickkunka,
Background
I hope you're able to understand the issue I'm having and know or have a solution.
Codepen
I am currently using the multifilter.parseOn:'submit' options for my filters, with a reset button. I have 2 sets of filters (as shown in the Codepen example), where one category has checkboxes laid out, and one category uses accordions to lay out the checkboxes. The experience I am seeking is this: users will need to interact with the filters first, then choose to see results only when they click on the "See sessions" [submit] button. Because this filter is using multifilter and using the "or" logic, users can check multiple checkboxes from any category and the results will show accordingly. If no results match, then an error message appears to change filters.
Once results are shown, there is a "Return to filters" button off to the side that follows the user as they scroll down. Clicking this button will bring users back to the top of the filters options. Users also have the option to reset all filters by clicking the "Clear filters" button.
Issue
My first issue now is that the "See sessions" button is clickable on page load, which shows results even when users have not interacted with the filters. I want this button to be disabled until users clicked AT LEAST one checkbox. It is currently set to disabled, but Mixitup changes that when it loads. How can this be accomplished?
My second issue now is that clicking the "Clear filters" [reset] button only clears the filters, but it doesn't reset the results to the default state. I am aware that the reset default functionality of the plugin is to reset the results to their original state, but this somehow is changed with the usage of the parseOn: 'submit' option. How can this be overcome?
To iterate, my goals for this experience are:
- Disable the "Submit" button until at least one checkbox is checked
- When resetting the filters, also reset the results while using
parseOn: 'submit'.
Thank you in advance!