> For the complete documentation index, see [llms.txt](https://docs.bravostudio.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bravostudio.app/bravo-tags/form-and-input-fields/stateful-input/required-checkbox.md).

# Required Checkbox

A required checkbox is necessary feature in digital forms and agreements, requiring users to explicitly agree to specific terms before proceeding. Key uses include terms and conditions, privacy policy, risk acknowledgment, age verification, etc.

{% hint style="danger" %}
[Firebase Authentication](/integrations/user-authentication/app-login-firebase.md) currently does not support this feature.
{% endhint %}

In this guide, you'll learn how to make a checkbox or any toggle mandatory.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FU9teg68Wvfopo4i5hmVw%2FScreen-Recording-2024-04-19-at-11.47.10.gif?alt=media&amp;token=e07a7e6b-a63d-4b8f-b5ba-833d5e818270" alt=""><figcaption></figcaption></figure>

## 👉 The tags

To apply the stateful input:

```
[input-state-set:{identifier-name}] // add the input functionality
[state:default] // sets the default state
[state:active] // sets the active state
```

To make the input mandatory:

```
[forced-selected]
```

To send the input value to the backend use:

```
[input-value:0]
[input-value:1]
```

## 🏷️ How to add the tag

Here's how you can implement it:

1. Create and design your stateful input by following the steps below:

{% content-ref url="/pages/pBEbtVdB8cRb5R0JlS39" %}
[Stateful input](/bravo-tags/form-and-input-fields/stateful-input.md)
{% endcontent-ref %}

2. Apply the `[force-selected]` tag to the input group to make the input field mandatory.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2F7y5PdPwve8mIaeLQsFU7%2FRequired%20Checkbox3%20(1).jpg?alt=media&amp;token=cdaa15c4-421c-46a1-901a-701466c4c1dc" alt=""><figcaption></figcaption></figure>

2. Specify `[input-value:0]` for the default state (False), and `[input-value:1]` for the active state (True).

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2Fk3JjoDbnAp3mg9An8lL0%2FRequired%20Checkbox3.jpg?alt=media&amp;token=ce94405e-8b59-4642-89a2-5ba5ab614045" alt=""><figcaption></figcaption></figure>

3. Ensure that you add the `[action:submit]` attribute to the submit button. This will trigger the action to submit the data to your backend.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FhqcoyUNt0Q92JOVHkwpN%2FRequired%20Checkbox4.jpg?alt=media&amp;token=1ccc8489-40b7-4234-b77a-a3aca7efa9f9" alt=""><figcaption></figcaption></figure>

## 🔌 Binding with the API

To bind:

1. On the left side of the screen, under "**Elements**," select the group element representing the checkbox. In this case, we're selecting the default state. Alternatively, you can choose the element directly from the image in the middle of the screen.
2. On the right-hand side, under "**Form Data,**" connect the form input to the request variable. To achieve this, choose your data collection, the [POST request](/connect-api/set-up-api-requests/creating-an-api-collection/airtable/data-library-connect-to-any-api-post-request.md), and finally, the variable named `verified`.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FxQgTB2kWppFmFRZhpg4m%2FRequired%20Checkbox2.jpg?alt=media&amp;token=50090b22-ee55-4e8d-b90b-2978efd90948" alt=""><figcaption></figcaption></figure>

3. Don't forget to set up the Form Response (On Success and On Error) by clicking on the element where the `[action:submit]` tag is located.&#x20;

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FN3P7xQIZxjYYFVVfzkZu%2FRequired%20Checkbox5.jpg?alt=media&amp;token=6103e4f2-edaa-4ea8-8bbd-72670d41952a" alt=""><figcaption></figcaption></figure>

## 💾 Example File

Duplicate the files below to see how to set it up!

{% embed url="<https://www.figma.com/community/file/1363154305517504845>" %}

Your feedback is valuable to us. If you have any suggestions or questions, please don't hesitate to reach out to us in the [community](https://community.bravostudio.app/home).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bravostudio.app/bravo-tags/form-and-input-fields/stateful-input/required-checkbox.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
