So the problem is the autocomplete combobox is initialized without the change event. I want to bind it afterwards but the documentation seems to be inadequate about the combobox.
Code that doesn't work:
$('#select').combobox();
...
$('#select').bind( "autocompletechange", function(event, ui) {
alert('changed');
});
I am guessing the event label is wrong since the inline label on the combobox is "selected" e.g. $('#select').combobox({selected : function(ev,ui) { alert('selected'); }});
works but I can't use it that way.
So any idea what's the correct label of the event? I just can't find it in the documentation.
EDIT: Actually I found where my problem was. $('#select').combobox();
just maps a select to an autocomplete input. The input it creates has an id like id='select-autocomplete'
, so to bind and event to that combobox - the selector should be on this input instead on the select. So the working code:
$('#select').combobox();
...
$('#select-autocomplete').bind( "autocompletechange", function(event, ui) {
alert('changed');
});