Switch

Categories

Component ID

1452218

Component name

Switch

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

3132

Component created

Component changed

Component body

Provides an iphone-like switch form element & widget.

There are two ways to use it:

1. Field UI
A widget is provided for checkbox (boolean) fields. When creating a boolean field, select 'switch' as the widget.

2. Form API
The module defines a new form element type 'switch' - use as you would a checkbox.

$form['example'] = array(
  '#type' => 'switch',
  '#title' => t('Example'),
); 

Development of this module was carried out by Ben Scott for the Scratchpads project.