- This topic is empty.
March 15, 2016 at 12:32 am #239203Ilan FirsovParticipant
I’m working on a project where I have a huge list of items in a
<select multiple>element and the user can select any amount of items (cities and towns).
Usually I’m working with Chosen or Select2, both have a nice way to handle multi select, and both require jQuery to work.
This time I don’t really need jQuery anywhere else in the project and I’m looking for a new plugin that doesn’t use it to drop jQuery entirely. Any ideas?March 19, 2016 at 3:00 pm #239606JerbaParticipant
I don’t how how extravagant you want it to be, but you can probably write the functionality yourself, it’s relatively straightforward. Here’s a quick pen which should help you get started.
I hope this was helpful.March 21, 2016 at 12:06 am #239636Ilan FirsovParticipant
Thanks for your input, but that implementation is not really user friendly.
I was thinking maybe something like this. It’s simple enough to build on my own, but then again, it’s only going to appear on one page so maybe using jQuery plugin is not that bad?March 21, 2016 at 7:14 am #239650JerbaParticipant
No problem, although it was never meant to be user friendly, I was just trying to demonstrate the basic functionality.
The pen above stores the selected values in an array so you can do what you want with them at that point, pretty much you just need to add a few lines of code to provide the ability to remove a selected item if so required and that’s probably it.
“it’s only going to appear on one page so maybe using jQuery plugin is not that bad”
If you were to use the example I gave you above, then you can simply manipulate the array values as you please and then post the entire array to where ever it needs to go.