Have users select from a very long list of answers

4 years 5 months ago - 4 years 5 months ago #86376 by Brimfulof
I want to create a survey where only certain values are allowed as an answer to a particular question, but the list of values is very long (about 30,000) so a list of radio buttons or drop-down list is impractical.

Can anyone think of a good way to do this?

Two ways I've thought to do this are:
  1. Using jquery auto-complete, which I've seen mentioned here http://docs.limesurvey.org/Workarounds%3A+Manipulating+a+survey+at+runtime+using+Javascript&highlight=ajax
  2. With a search function
What I'm worried about with 1 is that if they don't start of typing the value in the correct way it won't appear. e.g. If they start typing 'The School of ...' rather than 'School of ...'. Is this the case or does it find what they are typing anywhere in the value?

Is 2 even possible? What I mean is that they type a partial answer, click 'search' and all possible values matching that answer are displayed, from which they can pick one.

Use case:
I want to ask people which school they attend.
I need to be able to collate all entries for each school, so I can't allow people to enter free text where some might call their school one thing and others something slightly different.
Last Edit: 4 years 5 months ago by Brimfulof. Reason: Making layout clearer and adding use case

Please Log in to join the conversation.

4 years 5 months ago #86406 by DenisChenu

with autocomplete option, the user can write schoool of ... and see the list:

jqueryui.com/demos/autocomplete/ : try script

Remove the matchContains: true, option. And you source file is a csv , text or php script with sql source ?


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).

Please Log in to join the conversation.

4 years 5 months ago #86801 by Brimfulof
Hi Denis,

Thanks foe the response, I'll have to give autocomplete a go to see how it works, from what you've said it looks like it could do the job.

I currently have the source file as csv. Is that the best format to have it in, or would it be best to convert it to something else?

Please Log in to join the conversation.

4 years 5 months ago #86828 by Mazi
CSV should work fine with the autocomplete plugin.

Check performance as well, 30.000 entries is already quite a lot (howlarge is your file?) and might use quite some ressourcs so don't wonder if you run into any server ressource limits.
If so, using an Ajax call to query the database directly would be an alternative approach.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.