solideogloria → - Did you end up creating a custom module for this? We have created 2 entity select dropdown with state and city taxonomies. But we are not clear on how to achieve the dependency between state and city dropdown. As you mentioned, Business rules module is not helping within the webform. Could you please add some more steps on how you achieved this?
Yes. You need a custom module. Download the webform handler → and put it as a PHP file in .../custom_module/src/Plugin/WebformHandler/
The elements in the example handler are called "first" and "second". Changing the value of "first" will update the values of "second". The second select element needs to be populated by an EntityReference view, and the view takes the value of "first" as an argument. The code in the webform handler passes the value to the view via AJAX when the value is changed.
solideogloria → Thanks for the response. Regarding first and second in the handler, should those be replaced by the webform field keys?
Yes, but you may need to use Xdebug or something else to determine what you need. If your fields are in Fieldsets or something, then it will change.
Couldn't get this working. Replaced with the webform element key, but its not working as expected. I see the handler in the webform, but its not working when we use the key. And not sure what else should be replaced with first and second as there is no field names for the webform elements. I just see something like "name=test", but that's also not working.
Webform elements don't show in the "fields", they show in
$form['elements']