One more word about this plugin.
It gets very very slow when there are many elements.
E.g. a list of 5000 elements took 12 seconds to show a result.
If you have many elements you should use this solution which is really fast.
Code:
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/1.0.11/jquery.csv.min.js"></script><script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function() {
var url = "/upload/surveys/{SID}/files/names.csv";
var Names = new Array(); $.get(url,function(data){
fullArray = $.csv.toArrays(data);
$(fullArray).each(function(i, item){
Names.push(item[0]);
}); $("#question{QID} input[type=text]:eq(0)").autocomplete({
minLength: 2,
source: Names
}); });});</script>
If there are only a few elements (150) you may have a look at the question theme "searchable dropdown", or even "Multiple Choice dropdown"
[url]
github.com/tpartner?tab=repositories
[/url]
Joffm