How can I make checkbox registration mandatory on the Dawn theme?

Topic summary

A user working with Shopify’s Dawn theme wants to make a checkbox mandatory on the registration form. They’ve successfully added the checkbox to the form but are struggling with two key issues:

Current Challenge:

  • Making the checkbox required/mandatory
  • Triggering an alert message when users try to proceed without checking the box

Technical Context:

  • The user has been modifying the theme code directly
  • They shared code snippets from their customer registration form (customer.css)
  • An image was included showing their current implementation

Status: The discussion remains open with no solution provided yet. The user needs help implementing form validation to prevent submission without consent checkbox confirmation.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

Hi, I am using the Dawn theme. I would like to make the checkbox mandatory for the register form, i have enjoyed modifying the code. here is the full code as it comes:

{{ ‘customer.css’ | asset_url | stylesheet_tag }}

{{ 'customer.register.title' | t }}

{%- form 'create_customer', novalidate: 'novalidate' -%} {%- if form.errors -%}

{{ 'templates.contact.form.error_heading' | t }}

{%- endif -%}
{{ 'customer.register.first_name' | t }}
{{ 'customer.register.last_name' | t }}
{{ 'customer.register.email' | t }}
{%- if form.errors contains 'email' -%} {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}. {%- endif -%}
{{ 'customer.register.password' | t }}
{%- if form.errors contains 'password' -%} {{ form.errors.translated_fields['password'] | capitalize }} {{ form.errors.messages['password'] }}. {% endif %} {{ 'customer.register.submit' | t }} {%- endform -%}

Dichiaro di aver preso visione dei Termini e condizioni del servizio.

Dichiaro di aver preso visione dell' Informativa Privacy.

Acconsento al trattamento dei miei dati personali per ricevere informazioni promozionali e rimanere sempre aggiornato sulle offerte e sulle novità cosi come previsto dall' Informativa Privacy.

Can someone help me please?

I managed to add the check list but i am still struggling to make them mandatory and send an alert message after user proceed without consent.