Jet\Form_Field_RadioButton / Form_Field::TYPE_RADIO_BUTTON

Represents a form field for selecting an option from a list of options using an element called a radio button.

Attention! The form field is not a single radio button, but a set of radio buttons corresponding to the defined selection options.

You need to familiarize yourself with the options chapter.

The Jet\Form_Renderer_Field_Input_RadioButton renderer is used to display the form field itself.

Default error codes

Code Meaning of
Form_Field::ERROR_CODE_EMPTY The field is marked as required and the value is not selected.
Form_Field::ERROR_CODE_INVALID_VALUE The entered value does not match any of the predefined values.

Parameters

Parameter Type Required Meaning of
select_options assoc array no List of options
select_options_creator callable no Calling a method that generates a list of selection options.

Methods

Method Meaning of
public setSelectOptions(
array|Iterator $options
) : void
Sets a list of options.
public getSelectOptions(
) : array
Returns the set list of options.
public optionIsSelected(
string $option_key
) : bool
Indicates whether the option is selected based on the captured and validated value (or default value) of the form element.
Previous chapter
Jet\Form_Field_MultiSelect / Form_Field::TYPE_MULTI_SELECT
Next chapter
Jet\Form_Field_Checkbox / Form_Field::TYPE_CHECKBOX