Adding Conditional Logic to form Confirmation Message [RESOLVED]

Hello. I have a form that has a Checkbox section on it with 5 choices.
The site visitor can select more than once choice at a time.
How can I set the conditional logic for the confirmation form to display a link pertaining to each of the choices selected? For example: If I choose, Option 1, Option 3, and Option 4, I want to be given the download link for each one I selected after I hit “Submit”. How can I achieve this?

Kind regards,
Tabatha

Hi @Jerryandtabatha,

Welcome to the forums! Gravity Forms Conditional Shortcode is what you’re looking for. There’s an example in the docs for how to apply this to a Checkbox field. Change the field ID in the example to match your Checkbox field, adjust the value from 10 to the specific option you want, then include your download link in the middle.

Note: it’ll probably take a bit of trial and error to get it working just right.

Good luck!

Thank you! I will be testing this out today and report back.

I just tried the code:

[gravityforms action=“conditional” merge_tag=“{Checkboxes:Green Quadrant:value}” condition=“contains” value=“1”]
My download link here
[/gravityforms]

After adding this code, and testing the form , once I hit Submit, no text appears at all on the confirmation message.

Does the code look right to you? I am not sure how to find the “Value” of each option in the checkbox.

Update: I FIGURED IT OUT!

This is the code I used on the confirmation message:

Thank you for your submission! Here are you download links:

[gravityforms action=“conditional” merge_tag=“{Checkboxes:9:value}” condition=“contains” value=“1”]
my download link here
[/gravityforms]

[gravityforms action=“conditional” merge_tag=“{Checkboxes:9:value}” condition=“contains” value=“2”]
my download link here
[/gravityforms]

[gravityforms action=“conditional” merge_tag=“{Checkboxes:9:value}” condition=“contains” value=“3”]
my download link here
[/gravityforms]

For each section of the code that has: {Checkboxes:9:value}
The “9” is the number of the form ID :
(you find this ID number in the form settings>Click the title of the checkbox>on the right side of the window you will see the ID number.

And where it says: “contains” value=“1”]
I set each checkbox value and change this number to match the choice value:
Click on form settings>click checkbox area>on the right side of the window, click on Edit Choices and you will see a tick box for “Show Values”. I set this as 1, 2,3 etc. Save form.

And lastly, this is how my confirmation settings look:

1 Like

The above method is working well, however, I am noticing that there are gaps in the spacing where an unchecked item is. For instance, when selecting options 1, 2, 4, & 5 , the confirmation appears like this for example:

Thank you for your response! Here are your download links:

Option 1
Option 2

Option 4
Option 5

See how it “skips” over the unchecked item leaving a gap? How can I fix this?

See the reply I just added here:

Thank you! I got it all sorted out, and now it’s executing beautifully!
Thank you so much for your help!

1 Like