ramo
ramo

Reputation: 363

showing values instead of labels value in input field with jquery-autocomplete

i've got the following code taken and slightly modified by the original example page:

http://jsfiddle.net/zK3Wc/21/

somehow, if you use the arrow down button to go through the list, it shows the values (digits) in the search field, instead of the label, but the code says, that on the select event, the label should be set as the value.

what i would need is to display the label in the searchfield instead of the digits, but if i click on an item, it has the digit value in the url, the same when using the arrow down button.

Ramo

Upvotes: 3

Views: 5534

Answers (2)

Robbie Smith
Robbie Smith

Reputation: 482

For me, I forgot to put return false; in the select: callback function

Upvotes: 4

jk.
jk.

Reputation: 14435

Add a focus event:

focus: function( event, ui ) {
            $( ".project" ).val( ui.item.label );
            return false;  
     },  

http://jsfiddle.net/zK3Wc/26/

Upvotes: 9

Related Questions