jquery autocomplete get selected item text

Posted by rlee923 on Stack Overflow See other posts from Stack Overflow or by rlee923
Published on 2011-06-21T08:13:54Z Indexed on 2011/11/20 1:51 UTC
Read the original article Hit count: 126

Filed under:
|
|

I am wondering how to grab the selected item's text value on jquery autocomplete.

I have initialised jquery as following :

$(document).ready(function (){
    $("input#autocomplete").autocomplete({
        source: postcodelist,
        select: function (event, ui) {
            AutoCompleteSelectHandler(event, ui)
        }
    });
});

And I have created a function function AutoCompleteSelectHandler(event, ui) { }.

Inside this function I want to some extra handling to feed data into correct textboxes but I can't figure out how to grab the text value of the selected item.

I did google a bit and tried examples but I can't seem to get it working.

Any help will be much appreciated.

Thanks a lot advance.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery