Switch

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.

Project information

Releases