Is this module able to limit choices in a select list based on user's choices in a previous form field? Example: a checkbox select list asks users to check off all the pets they've ever owned:
dog
cat
fish
bird
hamster
snake
frog
turtle
User selects dog, cat, and hamster. Now we want to know which of these three was their favorite pet. We could repeat the whole list, but limiting the radio buttons to dog, cat, and hamster would give the most consistent response. Can this module support dynamic population of a list in this way?
Comments
Comment #1
svendecabooterThis is currently not possible, as the Webform Validation module is aimed at server side validation.
This could probably be fixed with AJAX / AHAH for the specific use case, but making it into a generic solution might prove quite hard.
Comment #2
svendecabooterHaven't looked at it closely yet, but perhaps http://drupal.org/project/conditional_fields can help?
Comment #3
m.e. commentedNo, Conditional Fields doesn't control select lists. It only allows you to hide/show an entire question based on the response to a previous one.
Comment #4
nicodv commented...i found this right now and i´m checking it: http://drupal.stackexchange.com/questions/10112/dynamic-select-list-in-t...
Comment #5
drupalreggie commentedsubscribing...
also just found this http://drupal.org/project/hierarchical_select
Comment #6
liam morlandThis isn't a validation request. This is about populating the options for a select list. It could be a feature in Webform. It sounds like a niche case, so it might go into its own module.
Comment #7
nicodv commentedI finally solved my problem using the Entity reference option limit module. I cannot express how happy I am of finding this module... just what I needed.
In case anyone needs to use it in node forms instead of webforms.
Cheers
nico
Comment #8
danchadwick commentedThis is outside the scope of webform core. This could be implemented with custom jQuery, though.
Comment #9
Pepelu commentedI came here looking for answer, so once I solved it, I decide to post my solution, for anyone for which could be helpful.
Here is the code of a form with three select lists (dropdowns) and a textarea. The selection on the first dropdown fills the second depending of the selected value, and the second change the third as well. Finally the selection on the third dropdown fills the textarea. It´s on Drupal 8.
https://github.com/PepeluXX/ajaxFormExample/tree/master