Autocomplete not firing on first character
Hi!
I have implemented the jQuery UI autocomplete script, but the autocomplete is not firing on first character.
I have an input field with a static value on page load. When I change this value, the autocomplete is not firing. When I delete the character I typed and type it again, the autocomplete is working.
Am I doing something wrong? I can't find any information about this problem.
- var quantities = ['10','20','25','30','35'];
- $('#quantity').autocomplete({
- minChars:1,
- noCache: true,
- source: function( request, response ) {
- var matches = $.map( quantities, function(quantity) {
- if ( quantity.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) {
- return quantity;
- }
- });
- response(matches);
- }
- });
I hope somebody can help me :)