Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
95
rated 0 times [  100] [ 5]  / answers: 1 / hits: 68043  / 14 Years ago, thu, july 22, 2010, 12:00:00

I've implemented autocomplete on an input field, but the box does not show up and firebug returns this.source is not a function. I've used autocomplete on other fields of the same page without any problems. (two textarea's).



I'm using the following code to debug, same effect if I run from script file or Firebug command line.



var fakedata = ['test1','test2','test3','test4','ietsanders'];
$(#omschrijving).autocomplete(fakedata);


running jquery 1.4.2 and jquery ui 1.8.2, both minified versions.



Does anyone have an idea how autocomplete works fine on the textareas but causes this malfunctioning on inputs?



Error & Stack trace:



this.source is not a function
http://facturatie.autodealers.nl/dev/resources/js/jquery-ui-1.8.2.custom.min.js
Line 570
close(Object { name=a})jquery....min.js (regel 570)
close(Object { name=a}, Object { name=c})jquery....min.js (regel 570)
response()

More From » jquery

 Answers
31

Answer is that the first parameter of the autocomplete should be an object containing the source property. This works



var fakedata = ['test1','test2','test3','test4','ietsanders'];
$(#omschrijving).autocomplete({source:fakedata});

[#96148] Tuesday, July 20, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
ryanulyssesb questions
Sat, Mar 20, 21, 00:00, 3 Years ago
Mon, Sep 14, 20, 00:00, 4 Years ago
Mon, Mar 9, 20, 00:00, 4 Years ago
Sun, Jul 7, 19, 00:00, 5 Years ago
;