# Class: Checkbox

## jala.Form.Component.Checkbox(name)

Subclass of jala.Form.Component.Input which renders and validates a checkbox.

## Constructor

#### new Checkbox(name)

Creates a new Checkbox component instance

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | Name of the component, used as name of the html controls.

Source:
  - jala/code/Form.js, line 2120

##### Returns:

A newly created Checkbox component instance

### Methods

#### checkRequirements(reqData)

Validates user input from checkbox.

##### Parameters:

Name | Type | Description
--- | --- | ---
`reqData` | Object | request data

Source:
  - jala/code/Form.js, line 2158

##### Returns:

null if everything is ok or string containing error message

#### parseValue(reqData)

Parses the string input from the form. For a checked box, the value is 1, for an unchecked box the value is 0.

##### Parameters:

Name | Type | Description
--- | --- | ---
`reqData` | Object | request data

Source:
  - jala/code/Form.js, line 2148

##### Returns:

parsed value

#### renderControls(attr, value)

Renders an checkbox to the response.

##### Parameters:

Name | Type | Description
--- | --- | ---
`attr` | Object | Basic attributes for this element.
`value` | Object | Value to be used for rendering this element.

Source:
  - jala/code/Form.js, line 2132