Cascading combos

More
7 months 2 weeks ago #149443 by mpac_limes
mpac_limes created the topic: Cascading combos
Hi everybody!

I want to filter some dropdown list questions depending on previous questions in the same section. Let's see an example...

Q1: Countries
Australia
Belgium
Croatia
Denmark
...

Q2: Cities
Brussels
Copenhagen
Perth
Sidney
Zagreb

Q3 Districts, Q4 Streets....

If the user selects Australia in Q1 the only visible options in Q2 should be Sidney and Perth

I've done this before over older versions of LS with some dirty and obscure javascript hacks. I hoped that in 2.63. that very same job could be done in an elegant way.

Does somebody know a simple way to get this filtering working?

Thanks

Please Log in to join the conversation.

More
7 months 2 weeks ago #149453 by tpartner
tpartner replied the topic: Cascading combos

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, mpac_limes

Please Log in to join the conversation.

More
7 months 2 weeks ago #149454 by jelo
jelo replied the topic: Cascading combos

mpac_limes wrote: Does somebody know a simple way to get this filtering working?

Tpartners idea sounds like the best workaround approach. You didn't state how big each list it.

Subquestionrelevance is not working with Dropdown, which would be a way to go when having not that many items per answerset.

A way to build dynamic answersets would be nice.
bugs.limesurvey.org/view.php?id=11688

Or you open a feature request for a drill-down question type. Which is 100% what you're looking for:
www.qualtrics.com/support/survey-platfor...uestions/drill-down/
The following user(s) said Thank You: mpac_limes

Please Log in to join the conversation.

More
7 months 2 weeks ago #149468 by mpac_limes
mpac_limes replied the topic: Cascading combos
I'm migrating quite a few surveys from LS 1.87 to 2.63 and updating and refactoring them in the process. Sometimes there would be lots of answers for the dropdown list, and autocomplete can be the reasonable solution there. Nevertheless, other questions have more limited answers and drill-down questions could do the job quite well without the extra setup needed for the jquery autocomplete.

I'll try the autocomplete approach first but I could definitely use the drill-down question too. Apparently I can't request the feature without a mantis user though.

Thank you tpartner and jelo.

Please Log in to join the conversation.

More
7 months 2 weeks ago - 7 months 2 weeks ago #149475 by Ben_V
Ben_V replied the topic: Cascading combos
Hi,

This reminds me a great (javascript-based) survey sample provided by Tony... years ago !!!

www.limesurvey.org/community-services/fo...-of-a-dropdown#90731

One of my fav !

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 7 months 2 weeks ago by Ben_V.

Please Log in to join the conversation.

More
7 months 2 weeks ago #149524 by DenisChenu
DenisChenu replied the topic: Cascading combos
In fact : base of cpVille can be 'easily' adapted for another database, maybe a 'countryTown' can be great here, but the database are .... really great.

Have a countryTown in 2 parts seems to be a good idea : 'select country' + 'select town' mùaybe in a multiple text question type or 2 short text ?

I have another plugin idea where :
- Using a single choice question type
- Remove the default dropdown and put a empty dropdown (or with one value if there are already a value set)
- Use this dropdown with a remote call to get the filtered value
- Update the 'answers' part when sublitting

After
- If admin user export response in text : the real name is shown
- BUT : if admin user try to look or update 'answers' : this surely break .... if there are a lot of answers : this surely break the survey logic file too (if you nhave , for example 2000 town)

Alternative solution for exporting : make own export plugin.....

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #149942 by Ben_V
Ben_V replied the topic: Cascading combos

Ben_V wrote: This reminds me a great (javascript-based) survey sample provided by Tony... years ago


I found another old useful post showing @DenisChenu 's amazing method for dropdown cascading management (remember that there is no relevance field at answer options level for this question type):

www.limesurvey.org/en/community-services...list-via-java-script

A live (basic) example is available here:

s465379752.mialojamiento.es/419299

BTW I attach the related lss sample + complete folder containing all required resources (have to be uploaded in your template folder).
/!\ made under 2.06 & not tested with 2.6x (requires adaptation probaly to place the ressources outside the template folder)

Hope this could help users dealing with spanish regions & other people needing starting with cascading combos ;)


File Attachment:

File Name: municip_esp.zip
File Size:139 KB

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Attachments:
Last Edit: 7 months 1 week ago by Ben_V.

Please Log in to join the conversation.

More
7 months 1 week ago #149982 by DenisChenu
DenisChenu replied the topic: Cascading combos
Currently : have the project to make a cleaner plugin for this : framagit.org/SondagePro-LimeSurvey-plugin/selectFilter

Near same javascript, but add it in "question advanced settings : filter by 'questioncode' "

framagit.org/SondagePro-LimeSurvey-plugin/selectFilter

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: Ben_V

Please Log in to join the conversation.

More
1 month 1 week ago #158538 by bremont
bremont replied the topic: Cascading combos
Hi, I downloaded and installed your pluguin but I do not know how to use it, you can help me

Please Log in to join the conversation.

More
1 month 1 week ago #158563 by DenisChenu
DenisChenu replied the topic: Cascading combos
Not ready currently, but for example

If you have QCODE with code A,B,C
you can filter dropdown2 with answer code A1,A2,A3,B1,B2,B3 … adding a javascript line
selectFilter_selectFilterByCode({QID},{QCODE.qid})

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now