Forums › Forums › Search & Filter Pro › Multi-Select (input type) – Allow clicking multiple options without holding CTRL
Tagged: ajax, multi select
- This topic has 7 replies, 2 voices, and was last updated 4 years, 9 months ago by Trevor.
-
Anonymous(Private) February 6, 2020 at 7:04 pm #233265
Hi,
I’m trying to set up a multi-select dropdown. My client would like to be able to open the dropdown and select multiple options, which would trigger a change in the filter results, but without holding down the CTRL key.
I’m guessing I would need to override the default on click behavior and trigger a new AJAX query, but I’m not totally sure how to do that. Does anyone have any tips on this?
Many thanks,
Anonymous(Private) February 6, 2020 at 10:24 pm #233284Is there a way to not have the search input field on the combobox and it would just be a drop down that you can select multiple items? If not, I think I can use JS to achieve the look I want, but just thought I’d ask in case I missed a setting somewhere.
Thanks again.
Anonymous(Private) February 7, 2020 at 7:41 pm #233444Hmm, that didn’t work but thank you for trying. I was able to force the search input to display: none in CSS. I’m now going to attempt to set up the dropdown so it stays open on click. I think I’ve got enough to keep going for now. Thank you Trevor!!
Anonymous(Private) February 8, 2020 at 3:10 am #233448Well, I tried both the Select2 and Chosen Comboboxes but they didn’t work out. In both cases, the dropdown closes every time you select from the dropdown. My client wants to leave the dropdown open and be able to select and deselect items.
So I’m back to square one. Is there way to trigger a click or on change event on an <option> which would activate the filter? I’ve tried this and it doesn’t seem to do anything.
Any help on this would be greatly appreciated!!
Erin
Trevor(Private) February 10, 2020 at 1:50 pm #233530The (universal) additional code to keep the box open is this:
$("#select").select2({ closeOnSelect: false; });
You may need to modify this along these lines (as per the previous post I referred you to):
$('select.sf-input-select').select2({closeOnSelect: false});
The box will still close once it loses the focus. You must also switch OFF our form Auto Submit option, and instead use a Submit button.
-
AuthorPosts