Welcome, Guest
Username: Password: Remember me

TOPIC: Look up or filter values for drop down menu?

Look up or filter values for drop down menu? 2 years 9 months ago #62876

  • Rowzdower
  • Rowzdower's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Hello - I'm wondering whether LimeSurvey has the ability to populate drop down menus with data from a table based on a user response. For example, I might ask a user to choose which state that they live in. On the next question, I want them to be able to choose from a list of cities. I want the survey to have the intelligence to only list cities within that state. In other words, I have a table with all the state-city combinations in it and either LimeSurvey would look up the results or filter the results based on the selection. Simple database stuff, but I'm perplexed on how to accomplish this in LimeSurvey short of creating a separate follow up question for each state.
The administrator has disabled public write access.

Re: Look up or filter values for drop down menu? 2 years 9 months ago #62879

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
Hello,

Maybe you can use some jquery autocomplete plugin.

jqueryui.com/demos/autocomplete/#remote
docs.jquery.com/Plugins/Autocomplete/autocomplete

Use a php function to create the array , and use extraParams to had the state in the request.

Some work :)
The administrator has disabled public write access.

Re: Look up or filter values for drop down menu? 2 years 9 months ago #62905

  • Rowzdower
  • Rowzdower's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
This looks very promising. Any tutorials on how create the array using php? That's a little over my head. I'm definitely willing to learn, though. Thank you for the suggestion.
The administrator has disabled public write access.

Re: Look up or filter values for drop down menu? 2 years 9 months ago #62906

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
Hello,

The demo of the plugin:
view.jquery.com/trunk/plugins/autocomplete/demo/
view.jquery.com/trunk/plugins/autocomplete/demo/search.phps


Google search:
- nodstrum.com/2007/09/19/autocompleter/
- sks.com.np/article/9/ajax-autocomplete-using-php-mysql.html

Etc , etc :)
Last Edit: 2 years 9 months ago by DenisChenu. Reason: Official demo of the plugin
The administrator has disabled public write access.
The following user(s) said Thank You: Rowzdower

Re: Look up or filter values for drop down menu? 2 years 9 months ago #62908

  • Rowzdower
  • Rowzdower's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I'll give it a shot. Thank you.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.099 seconds
Donation Image