I want to manually select an item in autocomplete and click it given the value.
Following code:
autocompleteitem.autocomplete("option", "autoFocus", true).autocomplete("search", autocompleteitem.val());
autocompleteitem is an object of input that holds the value i want to search for. Now this code successfully selects the first item from drop down but it does not click on it. I do not want to click on it myself i want it to happen somehow in that code.
I tried the following additions to the code above which didnt work:
.click(), .select(), .trigger('select'), .find('a').click(), .change()
is there any way i can do it?
thanks
please someone help
Take a look at this jqFAQ.com topic, this will help you to programatically pick the first matching option for a value and set it into the autocomplete textbox. There are few other autocomplete related faqs too, i think that may be useful for you.