Hi, I do not see a severe issue with your script.
Except:
a. The variable {QID} is a LimeSurvey system variable that always contains the actual questionID.
Therefore you should not change it.
b. Did you copy the script from a pdf or so?
You should not do this. There is always the chance that it contains some (hidden) HTML garbage.
c. You did not address the subquestions
Well, here the working script
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 type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#question{QID} input[type="text"]:eq(0)').autocomplete({
minLength: 1,
source: ["Adalbert Ameise", "Berta Biber", "Carlo Chinchilla", "Doris Dachs", "Emil Eidechse", "Florian Flamingo", "Gabriele Gnu", "Horst Habicht"]
});
$('#question{QID} input[type="text"]:eq(1)').autocomplete({
minLength: 1,
source: ["Adalbert Ameise", "Berta Biber", "Carlo Chinchilla", "Doris Dachs", "Emil Eidechse", "Florian Flamingo", "Gabriele Gnu", "Horst Habicht"]
});
$('#question{QID} input[type="text"]:eq(2)').autocomplete({
minLength: 1,
source: ["Adalbert Ameise", "Berta Biber", "Carlo Chinchilla", "Doris Dachs", "Emil Eidechse", "Florian Flamingo", "Gabriele Gnu", "Horst Habicht"]
});
});
</script>
You see the "eq(x)"? Here you address the subquestion, starting with 0.
By the way: Which script did you use before? The one that on your opinion doesn't work in version 5.x.
Joffm