fbpx

Gravity Forms Terms of Service Setup with Conditional Logic

THIS POST MAY CONTAIN AFFILIATE LINKS. PLEASE READ MY DISCLAIMER FOR MORE INFO.

Some time ago I posted, Awesome Add-ons for the Gravity Forms Plugin, and one of the plugins I recommended was, Gravity Forms Terms of Service Field. Ed recently commented that this plugin was no longer available.

This was a nice add-on that allowed you to, add a Terms of Service field that can disable the Submit button that will re-enable when the user scrolls through the Terms of Service.

I did a quick search and found two other plugins that would provide similar results.

GP Terms Of Service by Gravity Wiz (paid plugin)
Gravity Forms Terms of Service Field by WP Smith

Additionally, I thought I’d show you how to accomplish this without an additional plugin.

This tutorial is very basic and very simple solution.

If your terms of service is really long, you may just want to link to a separate page on your site.

The first steps are to create your form with Gravity Forms (not included in this tutorial).

Now that you have your form all setup, you need to add the terms of service section and setup the conditional logic to control the button availability.

Step 1: Add an HTML Block to your form

gravity forms terms of service

While in the form editor. On the right side of the screen you’ll see a section titled, “Standard Fields”. Open this section by clicking on the title.

Once the items are displayed, you want to click the “HTML” button.

Step 2: Setup the HTML field to function as your Terms of Service

Open the HTML block, and fill out the three available fields.

gravity forms HTML Block1. Field Label
This is just for admin use. And will not be displayed on your website.

2. Content
This section is where you will place your Terms of Service. Remember this section accepts HTML so your can layout your content however you’d like.

3. Margins
If you want the content to automatically align with your other form fields, do not check the box! If you are using a bunch of HTML to layout your content, you will likely want to check this box to eliminate any display issues.

Step 3: Add a checkbox field to your form

From the “Standard Fields”, you’ll click on the “Checkboxes” button to add a new checkbox field

Step 4: Setup the checkbox field

In this step, you’ll setup 3 fields in the “Properties” section and one field in the “Advanced” section.

gravity forms terms of service1. Properties: Field Label
Leave this field black. This would be used to display a title for this field, but this checkbox is an extension of the HTML block setup in step 2 so it doesn’t really need a title.

2. Properties: Choices
Delete all but one “choice” by clicking on the minus button to the right of the field.

Then, in the remaining option, you’ll want to type your message, “I have read and agree to the Terms of Service”.

3. Properties: Required
This is very important. When you are using a terms of service field it is usually because it is an important element. Therefore, you want to make sure this field is required. This will prevent anyone from submitting the from without first checking the box.

gravity forms terms of service1. Advanced: Admin Label
This field is for your sanity. Number 1 above, “Field Label”, was left blank, so when a form is submitted, the submission for this field would say something like Checkboxes: Field ID 23.

Step 5: Enable Conditional Logic for the submit button

To add a layer of protection, to prevent anyone from submitting without actually accepting your terms, you can hide the submit button until the checkbox we just setup in step 4 is checked.

gravity forms button conditional logic1. Switch to the Form Settings Screen
To do this, scroll to the top of your screen and look for the white navigation bar with option “Form Settings”, then click that link.

2. Set conditional logic
Scroll down to the “Form Button” section and make the following changes.

a. Check the box to “Enable Conditional Logic”
b. Set your settings as shown
c. Select your checkbox field
d. Make sure “is” is selected
e. Your checkbox field should automatically be selected

gravity forms button conditional logic

Be sure to use the comments if you have any questions or need some help getting this working.

Please note: The Gravity Forms Plugin (affilink) is required for this tutorial, and it is not a free plugin.

Advertisements

20 thoughts on “Gravity Forms Terms of Service Setup with Conditional Logic”

  1. Hello Chris:

    The information above is great, however I am trying to mimic a behavior from CF7 where the submit button is visible but not ‘clickable’ until a checkbox is checked. I can see the absolute certainty of hiding the button altogether until what you want is selected, but I like having the submit button visible. Any ideas?

    Thanks.

    Reply
  2. Thanks for sharing. The only problem I see with this is that Gravity Forms doesn’t keep the HTML field as a submitted form field. So if your Terms of Service change, there’s no record of what each person agreed to. I added a hidden field with the TOS statement in it. Also not ideal because I have to be sure I remember to update both any time it changes.

    Reply
  3. Thanks, this was extremely helpful and clear. Trey raises a good point, but I think unless you change TOS frequently, it should be easy to keep track by noting the date of submission and comparing to date of TOS change.

    Reply
  4. Thanks so much for this – really helped me figure out a problem that I was stuck on for over a month.

    Quick question though – is there a way to make it so that when the form is submitted, that it doesn’t reload the page the form was embedded in and have it stay stuck at the top of the page?

    The form I’m using is at the bottom of the page but if for example the user does not enter one of the required fields, they have to click “submit” and then scroll the whole way back to the bottom of the page in order to see that they had missed something.

    I’d rather not have an entirely separate page used for just the form but I’m stumped on how to fix this.

    Thoughts?

    Reply
    • I’m glad it was helpful, sorry you didn’t find it sooner!

      Did you enable Ajax when adding the form to the page? This allows the form to display errors and to be submitted without requiring the page to load.

      If you have not enabled ajax on the form, it’s a simple fix in the gforms shortcode on the page. Just make sure ajax=”true” is in the shortcode like below.

      [gravityform id="1" name="Example Form Code" title="false" description="false" ajax="true"]

      You can test it here => https://demo.chrisegg.com/gformshacks/sample-page/

      -Chris

      Reply
  5. Thanks for the guide, but as you see, when you have a required field for checkbox without label, there’s is a ugly Asterix (*) at the top of the field, how do you put the asterix beside the option so it doesn’t look this ugly?

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.