Starts validation for the element and all subelements according to the rules laid out in the element's validator.
Class Details
[line 28]
Wraps a group of radiobuttons.
HtmlForm doesn't deal with single radiobuttons but always with groups of them. But nonetheless I still do recommend radiobuttons for binary choices as well, since that's one the use-cases they've been designed for, instead of using a checkbox. Otherwise the buttons excatly behave like you would expect them to. Many options, one choice.
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 radio-values and values are the label-texts for each radiobutton. array('val1' => 'nice radiobutton', 'val2' => 'not so nice radiobutton', ...)
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 option, 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.)