Skip to main content

How To Make a Consent Form Required?

I've added a consent form on my webpage but I'm seeing that people are able to sign up on an action page without marking their input. Is there a way to make this field required?

Official response from

Any consent form on a page can be made required by following the steps mentioned below.  At the moment, there isn't a way to make consents required website-wide so we'll want to make these coding adjustments to particular theme/template files.

 

1. Open up the theme file in question.

If you are looking to implement consents to be required on all pages of a particular type (such as a Signup page), you'll want to open up the pages_show_signup.html within Theme > Templates.

Conversely, if you'd like to make consents required for a particular signup page, but not all, you'll want to create a custom template within the page in question.

 

2. Find the area within the file that has the coding mentioned below.

{% if page.show_consent_form? %}
{% include "consent_form_custom" %}
{% endif %}


3. Replace the second line of this element with the following code.

<div class="consent-form-container">

  {% if page.consent_form.headline != "" %}
    <h3>{{page.consent_form.headline}}</h3>
  {% endif %}

  {% if page.consent_form.content != "" %}
    <div class="consent-form__content">
      {{page.consent_form.content}}
    </div>
  {% endif %}

  {% for consent_option in page.consent_form.consent_options %}
    <div class="consent-form__option">
      <div class="row-fluid">
        <span>{{consent_option.description}}</span>
      </div>
      <div class="row-fluid">
        <div class="radio-inline">
          {% assign consent_name = consent_option.yes_radio_name | replace: '_', ']' | | replace_first: ']', '[' %}
          {% assign size = consent_name | size | minus:1 %}
          <span>
            <input type="radio" value="1" name="{{ consent_name | slice: 0, size }}" id="{{consent_option.yes_radio_name}}" required>
            <label class="radio" for="{{consent_option.yes_radio_name}}">
              Yes
            </label>
          </span>
          <span>
            <input type="radio" value="0" name="{{ consent_name | slice: 0, size }}" id="{{consent_option.no_radio_name}}" required> 
            <label class="radio" for="{{consent_option.no_radio_name}}">
              No
            </label>
          </span>
        </div>
      </div>
    </div>
  {% endfor %}
  
</div>

 

Once you hit the "Save and publish changes" button, the update will be made live and users will be required to provide an input to the consent form that has been added.

Share this post

Showing 2 reactions

Please check your e-mail for a link to activate your account.