I'm trying to customize a bootstrap dropdown with checkboxes and if I select a checkbox from dropdown the label name I want to be written on input dropdown delimited with ';
' like in uploaded picture when dropdown
is closed.
Here is a fiddle example.
The following code works in Bootstrap 4.1 if you add a function to show the menu on hover, but when you click the < li > then your checkboxes becomes unclickable. Anybody having a better solution please provide.
And add these JS codes:
UPDATE
The below code is working good but checkboxes events are fired twice so had to choose the
onchange
event instead ofonclick
and the jquery code as follows:
Not the most elegant solution - you will probably want to refine this somewhat, but this might get you started:
I know it's a old question but still, you can use this library to do almost (except the exact design you asked) what you want http://davidstutz.github.io/bootstrap-multiselect/#getting-started