Welcome, Guest
Username: Password: Remember me

TOPIC: Have users select from a very long list of answers

Have users select from a very long list of answers 1 year 11 months ago #86376

  • Brimfulof
  • Brimfulof's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
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: 1 year 11 months ago by Brimfulof. Reason: Making layout clearer and adding use case
The administrator has disabled public write access.

Re: Have users select from a very long list of answers 1 year 11 months ago #86406

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
Hello,

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 ?

Denis
The administrator has disabled public write access.

Re: Have users select from a very long list of answers 1 year 11 months ago #86801

  • Brimfulof
  • Brimfulof's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
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?
The administrator has disabled public write access.

Re: Have users select from a very long list of answers 1 year 11 months ago #86828

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.098 seconds
Donation Image