How to Create an Agree to Terms Checkbox in Shack Forms

You may have many reasons to create an "Agree to Terms of Service" or similar checkbox field in your Shack Form.

Your form submitter will view this field as a checkbox with a clickable URL:

agree to terms checkbox

Once they clicked the URL, they will see a modal box with the text of your Terms of Service:

02 modal box with the text of terms of service

Creating such a field is a three-step process:

  1. Create a Joomla article with your Terms of Service
  2. Create a menu item for this article
  3. Create "Agree to Terms of Service" field by the "Single checkbox" type.

Step #1. Create a Joomla article with your Terms of Service

  • In your Joomla administrator panel, go to Content > Articles > Add New Article:

go to content articles add new article

  • Create a Joomla article with your Terms of Service. For my demonstration, I created an article with the title "Our Terms of Service":

article for my demonstration

Good job! You now have a Joomla article with your Terms of Service. To be able to display this article to your Shack Form submitter, Shack Forms need to know the article's URL. 

Let's get this URL. 

Step #2. Create a menu item for this article

To get the article's URL, you need to create a menu item, pointing to this article. The menu item doesn't have to be displayed if you create it purely for your Shack Form. It can be hidden. 

Very often, as a Joomla site growth, it needs a few hidden menu items. A good practice is to create a separate menu for such hidden menu items.

This is exactly what you will do in this step.

  • Go to Menus > Manage > Add New Menu:

go to menus manage add new menu

  • Create a new menu. I called mine "Hidden Menu":

my hidden menu

  • Go to Menus > Hidden Menu > Add New Menu Item:

go to menus hidden menu add new menu item

  • Create a new menu item pointing to your "Terms of Service" Joomla article. For my demonstration purposes, I called my hidden menu "Terms of Service":

my terms of service hidden menu item

Note: to make this menu item hidden, make sure to set its "Display in Menu" setting to "No" under the "Link Type" tab:

set display in menu to no

  • Click Save.
  • Copy the URL from the "Link" field:

copy the url from the link field

Excellent! You now have the URL of your "Terms of Service" Joomla article. You are now ready to create the "Agree to Terms of Service" checkbox field.

Step #3. Create "Agree to Terms of Service" checkbox

  • Open up your Shack Form module.
  • Under the "Module" tab click "Add new field":

click add new field

  • Enter "Agree to Terms of Service" into the "Field label" box.
  • Go to the "Field type" and select "Single checkbox":

select single checkbox field type

  • Go to the "Agree to rules URL or HTML element ID" field and paste in it the URL you copied in the previous step. Add at the end of your URL &tmpl=component. You should end up with having in this field URL resembling index.php?option=com_content&view=article&id=71&tmpl=component.
  • Click Required.
  • Click Save.

Excellent! Now when you check your Shack Form, you will notice the clickable "Agree to Terms of Service" checkbox, as you saw in the screenshot at the beginning of this tutorial.

When you click on it, you will see your Joomla article with Terms of Service in a modal box, once again, just as you saw in the screenshot at the top of this tutorial.