This is nearly a verbatim post of this question. However, once you flip over to jQuery 1.10, the code no longer works.
I did change the call to the "live" method, and switched it over to utilize the newer "on" method.
What else do I need to do to fix this http://jsfiddle.net/sacredfaith/6t74T/458/ ?
$(function() {
var options = {
source: [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
],
minLength: 2
};
$(document.body).on("keydown.autocomplete", "input.searchInput",function(){
$(this).autocomplete(options);
});
var addInput = function() {
var inputHTML = " <input name='search' value='' class='searchInput' maxlength='20' />";
$(inputHTML).appendTo("form#myForm");
$("input.searchInput:last").focus();
};
if (!$("form#myForm").find("input.searchInput").length) {
addInput();
}
$("input#addButton").click(addInput);
});
My searches thus far have yielded methods which use deprecated jquery libraries. I'm needing a more updated version, but haven't been able to find success for the past several hours of working on this...
EDIT: Fiddle link and code updated to reflect "on" syntax changes.
EDIT2: Thanks to all for your patience.
REFERENCE: For 1.10 solution see fiddle in comments of chosen answer, otherwise using 1.9, see fiddle in chosen answer directly.