- Posts: 153
- Thank you received: 8
Ask the community, share ideas, and connect with other LimeSurvey users!
Q00005 == "Groß-Enzersdorf" or "Zwettl-Niederösterreich"
I am sure you can do that by adding the results of the first two questions to the name of adapted csv files, like
municipality{Q1}{Q2}.csv
<?php $param=$_GET['param']; $countriesArr = array(); $file_handle = fopen("myCSVfile".$param.".csv", "r"); ....
$('#question'+qID+' input[type="text"]').autocomplete({ minLength: 2, source: [ "Eisenstadt", "Rust", "Breitenbrunn am Neusiedler See", "Donnerskirchen", "Großhöflein", "Hornstein", "Klingenbach", "Leithaprodersdorf", "Mörbisch am See", "Müllendorf", "Neufeld an der Leitha", "Oggau am Neusiedler See", "Oslip", "Purbach am Neusiedler See", ....
var url = surveyRoot+"upload/themes/survey/extends1_bootswatch/gemeindenamen_liste{Q1}.csv";
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var qID = {QID}; var surveyRoot = location.pathname.split('index.php')[0]; var url = surveyRoot+"upload/themes/survey/extends1_bootswatch/gemeindenamen_liste{Q1}.csv"; // Create an array to hold the data var province= new Array(); // Grab the CSV contents $.get(url,function(data){ // Convert CSV contents to an array of arrays fullArray = $.csv.toArrays(data); // Load the data array $(fullArray).each(function(i, item){ province.push(item[0]); }); // Initialise the autocomplete plugin $('#question'+qID+' input[type="text"]').autocomplete({ source: province }); }); }); </script>
<?php $param=$_GET['param']; $countriesArr = array(); $file_handle = fopen("myCSVfile".$param.".csv", "r"); ....