About AutoComplete Suggestions
Hello everyone,
I would like to learn how to make this feature :
Let's say that we have an input with id="myList" we transform into an autocomplete select box.
- $(function()
- {
var availableTags =
- [
- "c++",
- "java",
- "php",
- "javascript"
- ];
$("#myList").autocomplete(
- {
source : availableTags,
});
});
I would like that the 1st value in the suggest list to be focused automatically but above all I would like that this 1st result be assigned as myList value.
At this moment i've tried with
- $("#myList").autocomplete(
- {
source : availableTags,
open : function(event, ui)
{
$("#myList").val("test");
}
});
And the value is well assigned with menu always displayed but I can't get 1st item (or any other) of the suggest list.
Thx