1

For example, i want to search the word in "name" and "code" fields at the same time. How can i do that? Maybe something like: getValue: "name", "code",

var options = {
 url: "http://easyautocomplete.com/resources/countries.json",

 getValue: "name",

 list: {
  match: {
   enabled: true
  }
 }
};

$("#provider").easyAutocomplete(options);
<html lang="en">
<head>
  <meta charset="utf-8">

  <title>Test</title>

  <!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
  <![endif]-->
</head>

<body>
<input type="text" id="provider"/>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://easyautocomplete.com/dist/jquery.easy-autocomplete.min.js"></script>
</body>
</html>
radeveloper
  • 926
  • 2
  • 12
  • 20

1 Answers1

0

You should be able to pass a function to the getValue option, like so:

     getValue: function(element) {
         var my_value = element.name + ' ' + element.code;
         return my_value;
     },

See their docs for more information.

Luckytechy
  • 79
  • 1
  • 8