10

i am using twitter bootstrap for my project.

I want to add checkboxes in dropdown, something similar to http://jsfiddle.net/qG7c4/

File: bootstrap-dropdown.js

Example: http://twitter.github.com/bootstrap/javascript.html#dropdowns

problem is, that dropdown get closed on click of every checkbox, i don't want this to be closed on click of checkbox, so that user can select multiple checkboxes easily.

What changes i need to do in javascript for this?

1 Answer 1

16

Try stopping the propagation of the click event on your input elements like so:

$('.dropdown-menu input, .dropdown-menu label').click(function(e) {
    e.stopPropagation();
});

Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.