We have a select form element where the options are dependent on a selected option in a former select. I expect that we're not the first ones with this issue. Has anyone come up with a good solution? Or know if this will be included in a coming version of forms. We are now stuck with forms 3, but are planning to upgrade.
I think you should build the custom element
- Use standard optgroup https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
- or show 2 <select> tags, and depend on each other by some vanilla JS or jQuery plugin as you wish.
I think it is more complex (in Editor view) than benefit to have that cascading select form elements in Forms built-in.
We are now stuck with forms 3, but are planning to upgrade.
By the way, Forms 3 and 4 is 99% similar. Forms 4 improve (add one method to the base interface) to the validation service. So it is a fast-forward upgrade. Don't hesitate.