views:

93

answers:

1

Triggered when an item is selected from the menu; ui.item refers to the selected item. The default action of select is to replace the text field's value with the value of the selected item. Canceling this event prevents the value from being updated, but does not prevent the menu from closing.

$("#txt1").autocomplete({
    minLength: 1,
    source:  "abc.php",
    select: function(event, ui) 
    {
        event.preventDefault();
        //alert("Select");
        var label= ui.item.label;
        var value= ui.item.value;
        $('#txt1').val(ui.item.label);
    }
});
A: 

using this parameter selectFirst: false

phuoc