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

svendecabooter’s picture

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

svendecabooter’s picture

Haven't looked at it closely yet, but perhaps http://drupal.org/project/conditional_fields can help?

m.e.’s picture

No, 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.

nicodv’s picture

drupalreggie’s picture

subscribing...

also just found this http://drupal.org/project/hierarchical_select

liam morland’s picture

Title: populate select list dynamically based on previous selection » Populate select list options dynamically based on previous selection
Project: Webform Validation » Webform
Version: 7.x-1.0 » 7.x-4.x-dev

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

nicodv’s picture

I 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

danchadwick’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This is outside the scope of webform core. This could be implemented with custom jQuery, though.

Pepelu’s picture

I 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