in Education by
I have an autocomplete that's almost working as I want it to work. The problem that I have is that once I start searching for my items and I get a few suggestions, I would then like to use my arrows to click through the different suggestions. It toggles the different suggestions in the input field itself, but it doesnt move on to the list and "toggle" through them. This is my code function () { $("#geosearch").autocomplete({ minLength: 2, source: cities, focus: function (event, ui) { this.value = ui.item.label; event.preventDefault(); // Prevent the default focus behavior. }, select: function( event, ui ) { addLocation(ui.item); return false; } }); } What do I need to add to make it work? The funny thing is that all examples I find, have a working "arrow browsing" but my just wont do it :( JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If by arrow browsing you are referring to traversing through the suggestion list using your keyboard's arrow keys, then I think your focus method is the one where the action will take place. Is there any particular reason why you added the "event.preventDefault();" in the focus event? It may be cancelling out the focus event from getting raised properly and notifying jqueryui to move the highlight on the selected item to the next/prev one.

Related questions

0 votes
    I have an autocomplete that's almost working as I want it to work. The problem that I have is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I want to fill a jquery array with several names populated from a back end function. This is the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I want to fill a jquery array with several names populated from a back end function. This is the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I'm trying to capture the event of opening and closing the bootstrap accordion, but with the typescript the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I am trying to set text and value for both td tag and input tag at the same time. But after ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    When I use ajax call from a modal window, the request url seems not correct. I have a webserver ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to set text and value for both td tag and input tag at the same time. But after ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    We are planning to use the jQuery library to augment our client side JavaScript needs. Are there any major ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I'm trying to make an event listener for when a button is 'active' (has an .active class in my ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to make an event listener for when a button is 'active' (has an .active class in my ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to make an event listener for when a button is 'active' (has an .active class in my ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am having an issue with the following bit of code. I'm trying to retrieve the index of the li ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    I am having an issue with the following bit of code. I'm trying to retrieve the index of the li ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    I'm using Fancybox from FancyApps to preview content on my website. Always enjoy the sunny days! $(document ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    I am new to jquery and now trying to create a fancy box in jquery . I will explain its ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
...