Make radio/checkboxes field choices conditional logic

Hi Ryan,
Another question if this is available within your gravitywiz set:

I want to make some radio field chouces conditional logic, not the whole field itself.

Like:
If field X is not Z then choice 3 within field-id 3 should not be shown/visible.

I’m aware that I can make multiple radiofields with all the different combinations I need and then show, don’t show, all with conditional logic, but with 4 choices this make the form way to complicated.

Hello Keesjan. I do not know of a solution to disable individual options within a field, based on conditional logic. In the past, I have done it the messy way, with different individual radio button fields in the form, and showing each one conditionally based on the earlier choice.

You can use one choice per checkbox field, hide titles except first one and use CSS to shrink margin-bottom between fields. Use the Gravity Perk that limits choice selection across multiple fields this way you can use them as radio buttons if you want by choosing only one selection across multiple fields. Then you can apply conditional logic on each field and show or hide as you wish.

1 Like

If you have javascript / jquery skills, you can add some script to the page that evaluates the value of one field whenever it changes and hides / shows the radio choices accordingly.

Fortunately, Gravity puts very specific IDs on each radio choice so you can easily show or hide them with script. For example: id=“choice_4_1_0” is form 4, field 1, choice 0. jQuery("#choice_4_1_0").hide(); will hide the radio button and jQuery("#label_4_1_0").hide(); will hide the label.

You can use Gravity’s javascript API or generic javascript or jquery monitoring for field changes, clicks, mouse up, key up, etc. to watch the field that drives the decision then use code along the above lines to show and hide the choices.

Thanks to you all for ideas and repling to my question. I will play around with some solutions.

It’s been a while since this was originally posted, but we just posted an article on how you can achieve this using Populate Anything.

Hey Scott,

you know why the conditional choices is only available in older Gravity Forms v
ersions, while in the new one it’s disabled? :o

In the newer version there isn’t this button:
Tested this in 4 different accounts, 2 old versions 2 newer ones.

Hi Kemal,

I don’t speak German, so I’m relying on Google Translate, but that button looks like it came from another plugin that isn’t one of ours.