# Checkbox

Capture a True or False input from a user.

***

{% embed url="<https://www.youtube.com/embed/_kFy0eT3JQs?autoplay=1&rel=0&vq=1080>" %}
Add a checkbox
{% endembed %}

***

### Properties

1. **Checked**

   The value the user should see when the page loads for the first time. Choose from True, False or populate your checkbox with a bit/boolean value from your data.
2. **Read-Only**

   Set to True if you want the control to display as read-only (value can't be changed) on the page.
3. **Visible**

   Set to False if you don't want this control to render on the page and be visible to the user.

***

### Assigning data to a Checkbox

Example:

To display a checked Checkbox when the value retrieved by a SQL query equals 'True' (or a similar value, like 'Yes'):

1. Use an appropriate [Event](https://docs.stadium.software/features/events), e.g. *Load* (page) or *Click* (button) to which a *Decision* and a [*SetValue* ](https://docs.stadium.software/actions/set-value)action can be added.
2. Add an If/Else [*Decision*](https://docs.stadium.software/actions/decision-if-else) action to determine the value of the variable.
3. If the value is 'True', add a [SetValue](https://docs.stadium.software/actions/set-value) action to assign the 'True' value and the checked state to the CheckBox's *Checked* property.

***

### Retrieving data from a Checkbox

Properties that can contain data:

* Checked

Use an [action](https://docs.stadium.software/actions) to capture the values from the control. Go [here](https://docs.stadium.software/controls) for more details on how to collect data from controls.

***

### Events

1. **Change**

   An event that triggers when the checkbox is checked or unchecked.
