Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Choice of city

Choice of city 5 years 7 months ago #57298

  • nozil
  • nozil's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hi,

is it possible to do the following :

in question 1, ask for zip code of city (in france, zip code can be used for more than one city)
in question 2, select the city corresponding to that zip code.

Thanks a lot for your help.
The administrator has disabled public write access.

Choice of city 5 years 7 months ago #57299

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 370
  • Karma: 260
You can either create X following questions (X = number of ZIP codes) and show them depending on the previous answer by using conditions or adapt this workaround: docs.limesurvey.org/Workarounds%3A+Manip...wers_for_text_inputs

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: r_kockelkoren

Choice of city 5 years 7 months ago #57393

Hi,

I tried to use "method 1". But it doesn't work.
I've copied the jquery files into the template directory en inserted the code into the header of startpage.pstpl. I also copied the the javascript into the source of the text question.
What do I have to use for the ID of the text input question? Is that 25 or 28758X5X25?

Further, when I look at the source code of the (working) Demo I don't see the js script. In my own source I do see the code, but that must be wrong (since it is not working).

Please help.
The administrator has disabled public write access.

Choice of city 5 years 7 months ago #57414

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 370
  • Karma: 260
Please post a link to your test survey so we can have a look.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Choice of city 5 years 7 months ago #57420

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
What do I have to use for the ID of the text input question? Is that 25 or 28758X5X25?
Just 25 - it is the question ID, not the full SGQA.
Further, when I look at the source code of the (working) demo I don't see the js script...
That's because in the demo I put the JavaScript in template.js but it will work fine if placed in the source of a question text or question help.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Choice of city 5 years 7 months ago #57431

Hi,

I was testing on a xampp server, so I had to install Limesurvey on my webserver first.

Please see:
212.178.134.50/limesurvey/index.php?sid=87973&lang=nl
(only 1 question and this is the one with the cities)

Thanks in advance.
The administrator has disabled public write access.

Choice of city 5 years 7 months ago #57434

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9346
  • Thank you received: 1338
  • Karma: 386
Hello,

You need to put the sate var in one line :)
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
The following user(s) said Thank You: r_kockelkoren
Time to create page: 0.219 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form