Good morning,
I have the following code:
$("#close-request-field-clinic").autocomplete({ source: arrayClinic, delay: 0, minLength: 0, isDivider: function( item ) { return false; }, focus: function ( event, ui ) { $('#close-request-field-clinic').val( ui.item.label ); return false; }, select: function( event, ui ) { $('#close-request-field-clinic').val( ui.item.label ); if(ui.item.value == -1) { resetField('#close-request-field-clinic', false); } else { successField('#close-request-field-clinic'); setKey(finalValues, 'clinic', ui.item.value); if(msieversion()) { $(this).blur(); } } checkValidation(fieldCheck,'#close-request-personal-information-next'); return false; }, change: function( event, ui ) { alert('change'); if(!ui.item) { resetField('#close-request-field-clinic', false); removeKey(finalValues, 'clinic'); } checkValidation(fieldCheck,'#close-request-personal-information-next'); return false; } }).focus(function(){$(this).autocomplete("search", "")});
In most cases, this works great, however, it seems that when the field changes, the "change" event does not always fire.
When selecting an item from the list, it works fine, however, if you delete the values ββin the field using the backspace (delete) key, and then click on the text field, the change event will be < sometimes . Is there something that I am missing? .. It seems that it is not called when the values ββare deleted manually.
Regards, Josh
source share