- Posts: 16
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Dynamic values in dropdown (Cities) depending on selected State
- Effenberg0x0
- Topic Author
- Offline
- New Member
Less
More
8 years 8 months ago #123435
by Effenberg0x0
Dynamic values in dropdown (Cities) depending on selected State was created by Effenberg0x0
Hi, I have added a "Multiple Short Text" question as the first one in my survey, to gather some user info:
- First name
- Last Name
- State
- City
Then I used the info I found here at the forum to replace the "State" text field with a dropdown control with a list of states. It's working fine.
Now, for the real question: I have used the same script to also replace the "City" text field with a dropdown. But it would be great if this second dropdown would only show cities that are in the State selected in the previous dropdown.
In other words, is there a way to make it so that the values shown in the second dropbox (cities) are dinamically loaded, depending on what is set on the first dropbox (state)?
Regards,
Effenberg
- First name
- Last Name
- State
- City
Then I used the info I found here at the forum to replace the "State" text field with a dropdown control with a list of states. It's working fine.
Now, for the real question: I have used the same script to also replace the "City" text field with a dropdown. But it would be great if this second dropdown would only show cities that are in the State selected in the previous dropdown.
In other words, is there a way to make it so that the values shown in the second dropbox (cities) are dinamically loaded, depending on what is set on the first dropbox (state)?
Regards,
Effenberg
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11658
- Thank you received: 2742
8 years 8 months ago #123436
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Dynamic values in dropdown (Cities) depending on selected State
Yes, there is a way and there is an example somewhere here in the forum for Italian states and municiples. So first you choose the state in the first dropdown, and the second dropdown will then only show the municiples in that states.
If you can't find the example let me know and I send you an example file with the version with Brazilian states and municiples. but that might take a while, so better find the example here in the forum.
If you can't find the example let me know and I send you an example file with the version with Brazilian states and municiples. but that might take a while, so better find the example here in the forum.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- Effenberg0x0
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 2
8 years 8 months ago #123440
by Effenberg0x0
Replied by Effenberg0x0 on topic Dynamic values in dropdown (Cities) depending on selected State
I've been looking for the last hour and couldn't find it. I'd really appreciate it if you can provide me with a link, an example file, anything that could kick me in the right direction.
Thanks!
Thanks!
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11658
- Thank you received: 2742
8 years 8 months ago #123441
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Dynamic values in dropdown (Cities) depending on selected State
Have a look at this thread where I uploaded my solution (not sure if it is still on my dropbox, probably not). But there is also the original solution with a github link:
www.limesurvey.org/en/community-services...ey-question?start=10
www.limesurvey.org/en/community-services...ey-question?start=10
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.