Starts validation for the element and all subelements according to the rules laid out in the element's validator.
Class Details
[line 31]
Wraps a group of checkboxes.
HtmlForm doesn't deal with single checkboxes but always with groups of them. Checkboxes are meant to be a form of multi-select-widget. Of course you can use this for creating single checkboxes, but be aware that the whole thing will still handle as if n boxes where present.
If you want you implement a binary decision (yes/no), which checkboxes are often used for, I'd rather suggest the use of accordingly labeled radio-buttons, to make things easier and to use widgets in the way the were intended to.
Setting a title or css-classes for this element will not result in anything. Instead, set titles and classes for the options themselves, by using the appropriate methods.
This could be used for an even-odd-pattern for example. One specialty of this functionality: the classes cycle. If you have 4 options for example and you define two classes of "even" and "odd", there will be two subsequent groups of "even" and "odd".
The order of the classes is that in which the options have been defined.
The options have to be given in the form of an associative array, where keys are the box-values and values are the label-texts for each box. array('val1' => 'nice checkbox', 'val2' => 'not so nice checkbox', ...)
The same speciality here as with the classes: they cycle, if not enough were defined for all options. If you have 4 options and you define two classes, there will be two subsequent groups of of both titles.
The order of the titles is that in which the options have been defined.
Calculates the validity-status, based on the currently selected options, by applying the rules of a present validator. If there is none, the element is always valid.
Tags:
return:
element is currently valid yes/no
access:
public
Overrides FormElement::validate() (Starts validation for the element and all subelements according to the rules laid out in the element's validator.)