I am using the following code to dynamically create an INPUT element and assign auto complete features to it. There is some problem with the .autocomplete line because the next line which adds the element to td never gets executed.
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
var fileCodeAutoComplete = $("<input/>");
$(fileCodeAutoComplete).autocomplete({
source: availableTags
});
$(td).append(fileCodeAutoComplete);
Any ideas?
UPDATE 1:
I placed a try-catch around the autocomplete call and found the error to be:
“object does not support this property or method”.
This is weird because I have added the jquery-ui reference to the page.
UPDATE 2:
I updated the code to follows and still receive the “object does not support this property or method”.
var fileCodeAutoComplete = $("<input/>");
$(fileCodeAutoComplete).attr("id", "fileCodeAutoComplete");
try {
$("input#fileCodeAutoComplete").autocomplete({
source: availableTags
});
}
catch(ex) {
alert(ex.message);
}
$(td).append(fileCodeAutoComplete);
UPDATE 3: I made a new project and copy pasted the code and it worked but on the existing project it does not seems to be working. I think it might be the Microsoft Library is getting in the way.
UPDATE 4: SOLUTION
The problem was that someone else was referring to an older version of jQuery which was messing with the jQuery UI framework.
try giving in a selector rahter than a tag, like for example
then you give
you can refer the link