Reputation: 3743
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!
Upvotes: 3
Views: 3425
Reputation: 1
$(document).on('input', '.select2-search__field',function () {
//do your stuff
});
Upvotes: 0
Reputation: 61083
var myOriginalInputId = 'myId';
$('#s2id_ ' + myOriginalInputId).on('keydown', function() {
// do stuff
});
Upvotes: 2
Reputation: 1531
Are you referring to .keyup()?
$('#input').keyup(function(){
// function here
});
It detects a keyup event in an input box and executes a SIAF, as documented here;
Upvotes: 0