Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

detect typing in select2

I have a Select2, multiple: true, with tags. I would like to intercept the event of the user typing into the Select2 element. Not too sure if that's possible at all.

Any help would be greatly appreciated.

Thanks so much!

like image 508
Dragan Avatar asked Dec 07 '25 03:12

Dragan


1 Answers

var myOriginalInputId = 'myId';

$('#s2id_ ' + myOriginalInputId).on('keydown', function() {
    // do stuff
});
like image 88
isherwood Avatar answered Dec 12 '25 12:12

isherwood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!