input type=checkbox, checkbox checked unchecked selected
inputCheckbox
A simple checkbox, like this: .
You can specify 'on' and 'off' values for unchecked and
checked checkboxes which will be returned by
$clonefish->getElementValues().
According to the HTML specification, the unchecked
checkbox values are missing when forms are submitted.
Fortunately, Clonefish handles these cases well.
- Live examples:
- Definition:
<?php $config = Array( 'answer' => Array( 'type' => 'inputCheckbox', 'displayname' => 'This is a checkbox', 'html' => 'CLASS="inputfieldstyle"', 'value' => 0 // the value of 'onvalue' or 'offvalue' 'onvalue' => 1, // value returned for a checked checkbox 'offvalue' => 0, // value returned for an unchecked checkbox ) ); ?> - Possible validators:
- 'required'
- 'custom'
