Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Prefill text area next question based on previous answer

  • andrejkona
  • andrejkona's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 4 months ago #161134 by andrejkona
I am doing research about tourism. So I have first question:

Choose city or village:
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
 
    var choices = 'Badín,Baláže,Banská Bystrica,Brusno,Čerín,Dolná Mičiná,Dolný Harmanec,Donovaly,Dúbravica,Harmanec,Hiadeľ,Horná Mičiná,Horné Pršany,Hrochoť,Hronsek,Kordíky,Králiky,Kynceľová,Ľubietová,Lučatín,Malachov,Medzibrod,Moštenica,Motyčky,Môlča,Nemce,Oravce,Podkonice,Pohronský Bukovec,Poniky,Povrazník,Priechod,Riečka / okres BB,Sebedín - Bečov,Selce / okres BB,Slovenská Ľupča,Staré Hory,Strelníky,Špania Dolina,Tajov,Zbyňov,Žilina'.split(',');
 
    $('#question'+{QID}+' input.text').autocomplete({
      source: choices
    });
 
  });
</script>
This is textarea, where they start typing and write name of city or village.

In next question, I need them to confirm statistics. For example, they choose "Tajov" and here will be textarea with prefilled number, they can rewrite it or just leave it. For each city or village I have data and need to some script to link city name with date and prefilled textarea.

Thank you for your help
Andrej
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose