Conditionally Display a Field's Choices

I need a way to conditionally hide drop-down menu choices depending on input in an earlier field.

I tried to use the following plugin approximately 1 year ago, but it couldn’t handle placeholders…And now it no longer exists:
https://codecanyon.net/item/gravity-forms-dependency-fields/18851328

1 Like

You are trying to remove or otherwise make available specific choices in a field based conditionally on a previous selection in the form, is that correct?

Yes, that is correct.

I received the following from @chrishajer today via email:

I’m afraid that is not possible with any built in functionality. You should be able to mark a radio button option disabled using jQuery or JavaScript, and trigger that script based on a conditional logic change in the form or a selection made in the form. You can use the JavaScript hook gform_post_conditional_logic_field_action to run your script:

https://docs.gravityforms.com/gform_post_conditional_logic_field_action/

Here’s a quick write-up of how to enable or disable a radio input:
Enable/Disable Radio Button Using jQuery | FormGet

Thank you @chrishajer. Although I would certainly prefer a built-in option or alternatively a third-party plugin, I sincerely appreciate the work-around.

1 Like

Hey, I think that was me! Maybe someone can jump in with a proof of concept to show how this could be done.

How many dropdown changes are there? If it’s only a couple, you could do a “clunky” version by creating several versions of the dropdown and then have different ones being displayed depending on the previous conditional. If there are a lot of variations and changes this would be way too messy…

Just a thought…

Mad Dog

@Mad_Dog, That is exactly how I currently have it implemented - Multiple dropdowns that are conditionally hidden. It works, but because it essentially doubles the number of fields in my already large form, this implementation makes my form run really slowly.

1 Like

It was a good thought…and you had it first. :sunglasses:

Thinking out loud…it’s easy enough to write a function to auto-populate a dropdown. Now if there was a way to get a conditional to trigger a specific function…hmmmmm…

1 Like

Is there a better way to implement this yet?

Hi @lonepc, Populate Anything from Gravity Wiz might do the trick for you. You’d need a Gravity Wiz license, but considering everything they offer it’s definitely worth it in the long run.

Maybe also just check with them first to see if it will do what you need.

1 Like

Thank you @tcgsa - That looks very promising.

Do you know if it is possible to use their Limit Choices Perk in conjunction with their Populate Anything Perk? I can’t seem to figure out how…

To be perfectly honest, I don’t know - but I could try to find out for you.

Nice and quick - just got a reply back from David at Gravity Wiz:

“Hey Phil, it doesn’t work out of the box but we do support it via a snippet: https://gist.github.com/spivurno/70ab25d52955829465e5c6136e8e127d

1 Like