Solved

Down key next

Posted on 2014-04-23
3
244 Views
Last Modified: 2014-04-23
Good morning,
I'm trying to get my own AutoComplete add-in working, and a bit stuck trying to get down to select the next item in the list.

I belive my issue is that Im setting the autocomplete as a variable, then trying to add on the .selection range, as I keep getting the error message:-

Uncaught TypeError: undefined is not a function (index):29
(anonymous function) (index):29
jQuery.event.dispatch jquery-1.9.1.js:3074
elemData.handle jquery-1.9.1.js:2750

Ive uploaded my code to http://jsfiddle.net/7NU6M/1/ which should select the second 'hello' after you click on the 'Next'.

Im now stuck how to mix the variable and the class selector, any ideas????

Thank you
0
Comment
Question by:tonelm54
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 40016951
What is your thinking behind this line

var $selElement = newAutoComplete + $(".selected")

Open in new window


What is the plus doing?

What are you trying to achieve.

I suspect you are misusing the + and are probably wanting something like this

var $selElement = newAutoComplete.find(".selected");

Open in new window

0
 

Author Closing Comment

by:tonelm54
ID: 40016983
You suspected right :-) Thank you, that works
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 40017031
You are welcome - thanks for the points.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now