Chained Selects - Dynamic number of dropdowns/options based on first selection? [RESOLVED]

I’m using chained selects for a user to select a product and it’s available options, ie; Width, Length, and Color. However, some products also include a Style option. Currently, i’m using the gform_chained_selects_input_choices filter and for products that do not have a Style, i just set that option as ‘n/a’. However, it’d be great if I could bypass/hide this option if it’s not applicable. Is this possible?

Hi Daniel. I recommend opening a support ticket for this issue:

Thank you.

Hi Daniel, Did you figure out how to do this? I could use a solution for this also.

Hey Operator95, Based on the support I received, this is not really possible:

“Unfortunately the number of drop downs has to remain the same, so you can’t just hide one of them in the middle if there are no options.
The solution you came up with is the only way to handle this.”

My solution was for products without a Style option to return a text/value “No Style Options” with value of “n/a”, select it, but then also using the GF javascript action gform_input_change check if the option has a value of “n/a” and if yes, hide it with display: none.

Hope this helps.

Yes, that helps a lot. Great solution. I did something similar but did not think to hide it, just left “n/a” showing. I like what you did. Thanks! Have a good one!

1 Like