1

My client wants an input element for a custom form to behave like this:

  • Dropdown checkbox multiple
  • Autosuggest field

So if we have a list of countries (Spain, UK, USA), it can display all the elements, and allows to select several of them. And if it is a long list of countries, you could search by entering the few letters, and only those items which match the entered letters would appear.

As for the first behaviour, I have found the following module "Dropdwon checkboxes". As for the second one, I haven't found any module so far, but in the wild there is this example (see example: Filtering mode: (filter existing list) ).

Any idea on how could I get the result? Maybe injecting some custom Javascript (jQuery) code into the multiple checkbox customized with the first module, to add the autocomplete capabilities?

3

As you suggest you have achieved the first one so supposing you have a dropdown with values then you can use the jQuery plugin / javascript to make the select an Autocomplete field. You can use select2

Thanks

  • Thanks for the reply. I didn't know select2, it has good aspect for what I need. – Cesar Jan 4 '16 at 7:19
1

There a quite a few for that but my favorites are:

  1. Chosen
  2. select2 (as suggested by Mohit)
  • 1
    Thanks for the reply. I decided to use Chosen. As for select2, I will try it a little, but I think that I can convince the client to just use the functionality offered by Chosen, it has it all, in a different form, but you can autocomplete search and you can also multi-select, which is what he wanted. And even in better way, because with the method of input boxes, you must check all the list to see if it is correctly selected, and with their method, all the selected items are shown next to the input box. – Cesar Jan 4 '16 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.