ChoiceFormField
class ChoiceFormField extends FormField
ChoiceFormField represents a choice form field.
It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
Methods
Sets the value of the field.
Returns true if the field should be included in the submitted values.
Check if the current selected option is disabled.
Sets the value of the field.
Ticks a checkbox.
Ticks a checkbox.
Returns the type of the choice field (radio, select, or checkbox).
Returns true if the field accepts multiple values.
Checks whether given value is in the existing options.
Returns list of available field options.
Disables the internal validation of the field.
Details
in FormField at line line 51
__construct(DOMElement $node)
Constructor.
in FormField at line line 65
string
getName()
Returns the name of the field.
in FormField at line line 75
string|array
getValue()
Gets the value of the field.
at line line 116
setValue(string $value)
Sets the value of the field.
at line line 45
bool
hasValue()
Returns true if the field should be included in the submitted values.
at line line 60
bool
isDisabled()
Check if the current selected option is disabled.
at line line 76
select(string $value)
Sets the value of the field.
at line line 86
tick()
Ticks a checkbox.
at line line 100
untick()
Ticks a checkbox.
at line line 160
addChoice(DOMElement $node)
Adds a choice to the current ones.
This method should only be used internally.
at line line 179
string
getType()
Returns the type of the choice field (radio, select, or checkbox).
at line line 189
bool
isMultiple()
Returns true if the field accepts multiple values.
at line line 277
bool
containsOption(string $optionValue, array $options)
Checks whether given value is in the existing options.
at line line 297
array
availableOptionValues()
Returns list of available field options.
at line line 313
ChoiceFormField
disableValidation()
Disables the internal validation of the field.