Grabing JQuery autoComplete events
Grabing JQuery autoComplete events

Hi
I am trying to do the above but none of the JQuery events documented here get triggered: https://api.jqueryui.com/autocomplete/#event-change
I tried these:
$('.ui-autocomplete-input').autocomplete({
select: function (event, ui) {
alert("Hiya1");
}
});
$('.ui-autocomplete-input').on("autocompletechange", function (event, ui) {
alert("Hiya2");
});
$('.ui-autocomplete-input').on("autocompletecreate", function (event, ui) {
alert("Hiya3");
});
Editor autoComplete box has this mark-up:
Tried with name of control $('#DTE_Field_CustomerVoiceCLI.CLI') but no joy either.
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
<div data-dte-e="input-control" class="DTE_Field_InputControl" style="display: block;"><input type="text" id="DTE_Field_CustomerVoiceCLI.CLI" class="ui-autocomplete-input form-control" autocomplete="off"></div>
Code below won't work either:
` jQuery(function($){
For events not firing, its usually because the element was created after the JS was read, so you use a delegate that was already created. Maybe set the delegate to a element that is higher in the class tree. I just added an id to my body and did it off that:
You would then do this
Also I posted some autocomplete issues that I had, and you can look at the bottom for my code snippet using the editor.
That worked. Many thanks.