I am using the following javascript to implement an autofill function for U.S. counties in a text box (counties list shortened for readability):
Qualtrics.SurveyEngine.addOnload(function()
{
var textOptions = ["Abbeville","Acadia","Accomack","Ada","Adair","Adams","Addison","Aiken","Aitkin"];
Query('.InputText').autocomplete({
source: function(request, response) {
var term = request.term.toLowerCase();
var results = jQuery.grep(textOptions, function(item) {
return item.toLowerCase().indexOf(term) === 0; // Match from beginning
});
response(results.slice(0, 5)); // Show max 5 results
}
});
});
It is working, but the autocomplete options are positioned way below the text box as shown in the screenshot below. I tried some of the CSS options given in this thread, but they didn’t have any effect. What to do?
