Welcome, Guest
Username: Password: Remember me

TOPIC: Choice of city

Choice of city 3 years 9 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.

Re: Choice of city 3 years 9 months ago #57299

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5426
  • Thank you received: 307
  • Karma: 252
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

Re: Choice of city 3 years 9 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.

Re: Choice of city 3 years 9 months ago #57414

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5426
  • Thank you received: 307
  • Karma: 252
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.

Re: Choice of city 3 years 9 months ago #57420

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4372
  • Thank you received: 830
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Choice of city 3 years 9 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.

Re: Choice of city 3 years 9 months ago #57434

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6561
  • Thank you received: 872
  • Karma: 257
Hello,

You need to put the sate var in one line :)
The administrator has disabled public write access.
The following user(s) said Thank You: r_kockelkoren
Moderators: ITEd
Time to create page: 0.125 seconds
Donation Image