Javascript Jquery易自动完成错误

Javascript Jquery易自动完成错误,javascript,jquery,jquery-ui-autocomplete,Javascript,Jquery,Jquery Ui Autocomplete,我正在尝试使用Easy AutoComplete()来创建一个搜索下拉列表。这是我的代码,它显示了基于url返回的数据的列表,但是当我单击某个选项时,会出现两个错误: Uncaught TypeError: Cannot read property 'toLowerCase' of undefined at HTMLInputElement.<anonymous> (jquery.easy-autocomplete.min.js?body=1:11) at HTMLInputElem

我正在尝试使用Easy AutoComplete()来创建一个搜索下拉列表。这是我的代码,它显示了基于url返回的数据的列表,但是当我单击某个选项时,会出现两个错误:

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at HTMLInputElement.<anonymous> (jquery.easy-autocomplete.min.js?body=1:11)
at HTMLInputElement.dispatch (jquery.js?body=1:4625)
at HTMLInputElement.elemData.handle (jquery.js?body=1:4293)
at Object.trigger (jquery.js?body=1:4534)
at Object.simulate (jquery.js?body=1:4860)
at HTMLDocument.handler (jquery.js?body=1:5116)
我不想在单击该选项时发出任何get请求,我只想将textfield的值作为id。以下是我的代码:

 var options = {
        url: function(phrase) {
          return "/admin/customers.json?query=" + phrase;
      },
      listLocation: "customers",
      getValue: "id",
      template: {
        type: "custom",
        method: function(value, item) {
          return item.customers.last_name +","+ item.customers.first_name
        }
      }
       };
       $('#appointment_customer_id').easyAutocomplete(options);
 var options = {
        url: function(phrase) {
          return "/admin/customers.json?query=" + phrase;
      },
      listLocation: "customers",
      getValue: "id",
      template: {
        type: "custom",
        method: function(value, item) {
          return item.customers.last_name +","+ item.customers.first_name
        }
      }
       };
       $('#appointment_customer_id').easyAutocomplete(options);