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:
Returns:
A newly created Checkbox component instance

Methods

checkRequirements(reqData)

Validates user input from checkbox.
Parameters:
Name Type Description
reqData Object request data
Source:
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:
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: