Hello again and thaks for your time
I'm trying to use autocomplete using this code
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var qNameID = {p3.qid};
var qIDID = {p44.qid};
var qSID = {p55.qid};
var url = "{TEMPLATEURL}/views/unidades.csv";
var namesArr = new Array();
$.get(url,function(data){
fullArray = $.csv.toArrays(data);
$(fullArray).each(function(i, item){
namesArr.push(item[0]);
});
$('#question'+qNameID+' input.text').autocomplete({
source: namesArr,
select: function(event, ui) {
$(fullArray).each(function(i, item){
if(item[0] == ui.item.value) {
$('#question'+qIDID+' input.text').val(item[1]);
$('#question'+qSID+' input.text').val(item[2]);
}
});
}
});
});
});
</script>
this code autocomplete the p3 question and the value of p3 is searched in the csv file and inserts the value of column 2 and 3 in p44 and p55 questions
this code works only if p44 and p55 are next to p3 in the same group
is there any way to do the same but p44 and p55 questions will be in other group?