jquery autocomplete this.source is not a function error

后端 未结 7 1373
心在旅途
心在旅途 2020-12-11 00:04

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

7条回答
  •  北海茫月
    2020-12-11 00:42

    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});
    

提交回复
热议问题