Take the 2-minute tour ×

I was wondering if there is an option on the jQuery UI Selectable that will let me disable the CTRL+Click, but still keep the draggable for the multiple selection. On my project I want to be able for people to select multiples, but only by dragging, not by ctrl+clicking.

If there isn't, does anyone know a way I can achieve this?

Any information would be really helpful! :) Thanks!!!

share|improve this question
add comment

3 Answers

up vote 9 down vote accepted

Selectable uses the metaKey flag to do multi-select, so you can bind metaKey to be false on the mousedown before calling selectable. Then Ctrl+click will always be off. Make sure to bind before calling selectable though.

$('#selectable').bind("mousedown", function (e) {
            e.metaKey = false;

jsFiddle here

share|improve this answer
Thank You So Much!! :) I've been searching for this for days. hehe. –  typefasterjoel Apr 1 '11 at 19:45
Just in case someone (like me) get's here and is trying to implement the opposite (allow multi select without ctrl) - do e.metaKey = true; –  Michal Szyndel Jul 23 '13 at 9:53
add comment

There is another usage of this good solution above - if you want to be able to just use your mouse click to do all the selecting/unselecting, without the need for holding the CTRL for multiselects or for unselects - just always set the e.metaKey from EvilAmarant7x's example to true. It was exactly what I needed.

Edit: apparently someone already thought of that: Implement multiple selects with jQuery UI Selectable :)

share|improve this answer
add comment
$("#selectable").on("selectablestart", function (event, ui) {
event.originalEvent.ctrlKey = false;
share|improve this answer
add comment

Your Answer


