Solved

Down key next

Posted on 2014-04-23
3
248 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 54

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 54

Expert Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article discusses how to create an extensible mechanism for linked drop downs.
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)

773 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