I am using the jquery autocomplete API , I am trying to get the value from a textbox after it is select . Which listener should I be using to get the value from the textbox . I tried .focus but it only works after the textbox is clicked again. I need this event to be triggered when the value from the drop down is selected (as opposed to the search words typed in the textbox)
If I understood your problem correctly, maybe you need to bind to the close event of autocomplete widget.
$("#autocomplete").autocomplete({
source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"],
close: function (event, ui) {
alert($(this).val());
}
});
DEMO
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