asprin
Active member
I'm using the following code but the do not see the keyup event firing on the textbox.
When I try to type something in the input box, console was reporting the following error:
which means I'm not registering the keyup event right. Any suggestions?
HTML:
<xf:textbox autocomplete="off" data-xf-keyup="player-autocomplete" name="q" placeholder="Start typing a name" />
JavaScript:
var asprin = window.asprin || {};
!(function($, window, document, _undefined) {
'use strict';
asprin.Autocomplete = XF.Element.newHandler({
eventNameSpace: 'asprinAutocomplete',
init: function() {
console.log('init');
},
keyup: function(event){
console.log('typed');
}
});
XF.Event.register('keyup', 'player-autocomplete', 'asprin.Autocomplete');
})(jQuery, window, document);
When I try to type something in the input box, console was reporting the following error:
Uncaught TypeError: g[h]._onEvent is not a function
which means I'm not registering the keyup event right. Any suggestions?