Answer Detail

jQuery-ui autocomplete, select first item

kikme
kikme
8 Points
4 Posts

I'm using jquery autocomplete as:

    .autocomplete({
          source: function (request, response) {
              response($.ui.autocomplete.filter(
            data, extractLast(request.term)));
          },
          multiselect: true,
          selectedControlId: 'txtKeyword_NewQuestion'
      });

I want when search for any keyword the  first row should automatically selected. So that when ever user search for any keyword, he need to just press enter button to select in autocomplete box.

Total Answered: 2
Total Marked As Answer: 0
Posted On: 12-May-2018 22:07

Share:   fb twitter linkedin
Use $('selector').autocomplete({autoFocus:true});
 - Rahul Maurya  16-May-2018 08:40
Answers
Smith
Smith
Participant
348 Points
104 Posts
     

Use following:

$('selector').autocomplete({selectFirst:true});
Posted On: 16-May-2018 08:24
andro
andro
16 Points
8 Posts
     

Use this one:

.autocomplete({
          source: function (request, response) {
              response($.ui.autocomplete.filter(
            data, extractLast(request.term)));
          },
          multiselect: true,
          autoFocus: true,
          selectedControlId: 'txtKeyword_NewQuestion'
      });
Posted On: 16-May-2018 08:44
banner

Blog

Active User (0)

No Active User!
 Log In to Chat