I have a Jquery UI auto complete field on my page, and I need to do something when input becomes empty (i.e The user typed something in, then deleted all of it).
This event must fire regardless of whether what they typed in initially produced autocomplete results.
The point is to show a button if there are no autocomplete results for typed entry, and remove it if there are results OR the input is empty.
UPDATE I have tried this...
$('#employeeAutocomplete').change(function() {
alert("eventFired");
if($( "#employeeAutocomplete" ).val() == ''){
$('#createEmployeeBtn').hide();
}
});
And alert is not displayed....
Thanks, Danny
http://forum.jquery.com/topic/autocomplete-and-change-event
About the same problem:
I've found the change: does work, but only when the input loses focus.
The solution I implemented, to get the effect I desired was to implement my own check as part of the source: function. I set minLength: to 0, and if the length was less than 2 I loaded my default display data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With